/*
 * Copyright (c) 2011, Michael van der Westhuizen
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *    - Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *    - Redistributions in binary form must reproduce the above
 *      copyright notice, this list of conditions and the following
 *      disclaimer in the documentation and/or other materials provided
 *      with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
#ifndef PYXMLSEC1_XMLSEC_C_MCVDW_20101121
#define PYXMLSEC1_XMLSEC_C_MCVDW_20101121

#include "pyxmlsec.h"

#include <xmlsec/errors.h>





PyDoc_STRVAR(xmlSecInit_doc, "Initialises the xmlsec1 library.");
static PyObject * xmlsec_xmlSecInit(PyObject * self, PyObject * args)
{
    if (0 != xmlSecInit())
    {
        ENSURE_EXCEPTION_SET(xmlSecInit);
        return NULL;
    }

    Py_RETURN_NONE;
}



PyDoc_STRVAR(xmlSecShutdown_doc, "Uninitialises the xmlsec1 library.");
static PyObject * xmlsec_xmlSecShutdown(PyObject * self, PyObject * args)
{
    if (0 != xmlSecShutdown())
    {
        ENSURE_EXCEPTION_SET(xmlSecShutdown);
        return NULL;
    }

    Py_RETURN_NONE;
}


/* PyDoc_STRVAR(xmlSecCheckVersionExt_doc, "Uninitialises the xmlsec1 library."); */
static PyObject * xmlsec_xmlSecCheckVersionExt(PyObject * self, PyObject * args, PyObject * kwds)
{
    int major, minor, subminor, mode;
    static char * kwlist[] = {"major", "minor", "subminor", "mode", NULL};

    major = minor = subminor = mode = 0;

    if (!PyArg_ParseTupleAndKeywords(args, kwds, "iiii", kwlist, &major, &minor, &subminor, &mode))
    {
        return NULL;
    }

    /* mode is a xmlSecCheckVersionMode, one of xmlSecCheckVersionExactMatch [0] or xmlSecCheckVersionABICompatible[1] */
    if (xmlSecCheckVersionExt(major, minor, subminor, mode))
    {
        Py_RETURN_TRUE;
    }

    Py_RETURN_FALSE;
}



static PyObject * xmlsec_xmlSecCheckVersionExact(PyObject * self, PyObject * args)
{
    if (xmlSecCheckVersionExact()) 
    {
        Py_RETURN_TRUE;
    }

    Py_RETURN_FALSE;
}



static PyObject * xmlsec_xmlSecCheckVersion(PyObject * self, PyObject * args)
{
    if (xmlSecCheckVersion())
    {
        Py_RETURN_TRUE;
    }

    Py_RETURN_FALSE;
}


/*
 * *****************************************************
 * *****************************************************
 * *** Source for objects
 * *****************************************************
 * *****************************************************
 */
#include "app.c"
#include "base64.c"
#include "bn.c"
#include "buffer.c"
#include "dl.c"
#include "io.c"
#include "keyinfo.c"
#include "keys.c"
#include "keysdata.c"
#include "keysmngr.c"
#include "list.c"
#include "membuf.c"
#include "nodeset.c"
#include "parser.c"
#include "templates.c"
#include "transforms.c"
#include "x509.c"
#include "xmldsig.c"
#include "xmlenc.c"
#include "xmltree.c"


/*
 * *****************************************************
 * *****************************************************
 * *** Module Initialisation
 * *****************************************************
 * *****************************************************
 */

struct module_state
{
    PyObject * error;
    PyObject * xmlSecFailed;
    PyObject * cryptoFailed;
    PyObject * xmlFailed;
    PyObject * xsltFailed;
    PyObject * ioFailed;
    PyObject * disabled;
    PyObject * invalidSize;
    PyObject * invalidData;
    PyObject * invalidResult;
    PyObject * invalidType;
    PyObject * invalidOperation;
    PyObject * invalidStatus;
    PyObject * invalidFormat;
    PyObject * dataNotMatch;
    PyObject * invalidNode;
    PyObject * invalidNodeContent;
    PyObject * invalidNodeAttribute;
    PyObject * missingNodeAttribute;
    PyObject * nodeAlreadyPresent;
    PyObject * unexpectedNode;
    PyObject * nodeNotFound;
    PyObject * invalidTransform;
    PyObject * invalidTransformKey;
    PyObject * invalidUriType;
    PyObject * transformSameDocumentRequired;
    PyObject * transformDisabled;
    PyObject * invalidKeyData;
    PyObject * keyDataNotFound;
    PyObject * keyDataAlreadyExist;
    PyObject * invalidKeyDataSize;
    PyObject * keyNotFound;
    PyObject * keyDataDisabled;
    PyObject * maxRetrievalsLevel;
    PyObject * maxRetrievalTypeMismatch;
    PyObject * maxEncryptedKeyLevel;
    PyObject * certificateVerifyFailed;
    PyObject * certificateNotFound;
    PyObject * certificateRevoked;
    PyObject * certificateIssuerFailed;
    PyObject * certificateNotYetValid;
    PyObject * certificateHasExpired;
    PyObject * dsigNoReferences;
    PyObject * dsigInvalidReference;
    PyObject * assertion;


};

#if PY_MAJOR_VERSION >= 3
#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
#else
#define GETSTATE(m) (&_state)
static struct module_state _state;
#endif

static PyMethodDef xmlsec1_methods[] = {
    {"init",                                          (PyCFunction)xmlsec_xmlSecInit,                                     METH_NOARGS,                xmlSecInit_doc},
    {"shutdown",                                      (PyCFunction)xmlsec_xmlSecShutdown,                                 METH_NOARGS,                xmlSecShutdown_doc},
    {"checkVersionExt",                               (PyCFunction)xmlsec_xmlSecCheckVersionExt,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"checkVersionExact",                             (PyCFunction)xmlsec_xmlSecCheckVersionExact,                        METH_NOARGS,                NULL},
    {"checkVersion",                                  (PyCFunction)xmlsec_xmlSecCheckVersion,                             METH_NOARGS,                NULL},
    /* app */
    {"cryptoInit",                                    (PyCFunction)xmlsec1_xmlSecCryptoInit,                              METH_NOARGS,                NULL},
    {"cryptoShutdown",                                (PyCFunction)xmlsec1_xmlSecCryptoShutdown,                          METH_NOARGS,                NULL},
    {"cryptoKeysMngrInit",                            (PyCFunction)xmlsec1_xmlSecCryptoKeysMngrInit,                      METH_O,                     NULL},
    {"keyDataAesGetKlass",                            (PyCFunction)xmlsec1_xmlSecKeyDataAesGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataAesId",                                  (PyCFunction)xmlsec1_xmlSecKeyDataAesGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataDesGetKlass",                            (PyCFunction)xmlsec1_xmlSecKeyDataDesGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataDesId",                                  (PyCFunction)xmlsec1_xmlSecKeyDataDesGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataDsaGetKlass",                            (PyCFunction)xmlsec1_xmlSecKeyDataDsaGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataDsaId",                                  (PyCFunction)xmlsec1_xmlSecKeyDataDsaGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataGost2001GetKlass",                       (PyCFunction)xmlsec1_xmlSecKeyDataGost2001GetKlass,                 METH_NOARGS,                NULL},
    {"keyDataGost2001Id",                             (PyCFunction)xmlsec1_xmlSecKeyDataGost2001GetKlass,                 METH_NOARGS,                NULL},
    {"keyDataHmacGetKlass",                           (PyCFunction)xmlsec1_xmlSecKeyDataHmacGetKlass,                     METH_NOARGS,                NULL},
    {"keyDataHmacId",                                 (PyCFunction)xmlsec1_xmlSecKeyDataHmacGetKlass,                     METH_NOARGS,                NULL},
    {"keyDataRsaGetKlass",                            (PyCFunction)xmlsec1_xmlSecKeyDataRsaGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataRsaId",                                  (PyCFunction)xmlsec1_xmlSecKeyDataRsaGetKlass,                      METH_NOARGS,                NULL},
    {"keyDataX509GetKlass",                           (PyCFunction)xmlsec1_xmlSecKeyDataX509GetKlass,                     METH_NOARGS,                NULL},
    {"keyDataX509Id",                                 (PyCFunction)xmlsec1_xmlSecKeyDataX509GetKlass,                     METH_NOARGS,                NULL},
    {"keyDataRawX509CertGetKlass",                    (PyCFunction)xmlsec1_xmlSecKeyDataRawX509CertGetKlass,              METH_NOARGS,                NULL},
    {"keyDataRawX509CertId",                          (PyCFunction)xmlsec1_xmlSecKeyDataRawX509CertGetKlass,              METH_NOARGS,                NULL},
    {"x509StoreGetKlass",                             (PyCFunction)xmlsec1_xmlSecX509StoreGetKlass,                       METH_NOARGS,                NULL},
    {"x509StoreId",                                   (PyCFunction)xmlsec1_xmlSecX509StoreGetKlass,                       METH_NOARGS,                NULL},
    {"transformAes128CbcGetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformAes128CbcGetKlass,              METH_NOARGS,                NULL},
    {"transformAes128CbcId",                          (PyCFunction)xmlsec1_xmlSecTransformAes128CbcGetKlass,              METH_NOARGS,                NULL},
    {"transformAes192CbcGetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformAes192CbcGetKlass,              METH_NOARGS,                NULL},
    {"transformAes192CbcId",                          (PyCFunction)xmlsec1_xmlSecTransformAes192CbcGetKlass,              METH_NOARGS,                NULL},
    {"transformAes256CbcGetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformAes256CbcGetKlass,              METH_NOARGS,                NULL},
    {"transformAes256CbcId",                          (PyCFunction)xmlsec1_xmlSecTransformAes256CbcGetKlass,              METH_NOARGS,                NULL},
    {"transformKWAes128GetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformKWAes128GetKlass,               METH_NOARGS,                NULL},
    {"transformKWAes128Id",                           (PyCFunction)xmlsec1_xmlSecTransformKWAes128GetKlass,               METH_NOARGS,                NULL},
    {"transformKWAes192GetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformKWAes192GetKlass,               METH_NOARGS,                NULL},
    {"transformKWAes192Id",                           (PyCFunction)xmlsec1_xmlSecTransformKWAes192GetKlass,               METH_NOARGS,                NULL},
    {"transformKWAes256GetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformKWAes256GetKlass,               METH_NOARGS,                NULL},
    {"transformKWAes256Id",                           (PyCFunction)xmlsec1_xmlSecTransformKWAes256GetKlass,               METH_NOARGS,                NULL},
    {"transformDes3CbcGetKlass",                      (PyCFunction)xmlsec1_xmlSecTransformDes3CbcGetKlass,                METH_NOARGS,                NULL},
    {"transformDes3CbcId",                            (PyCFunction)xmlsec1_xmlSecTransformDes3CbcGetKlass,                METH_NOARGS,                NULL},
    {"transformKWDes3GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformKWDes3GetKlass,                 METH_NOARGS,                NULL},
    {"transformKWDes3Id",                             (PyCFunction)xmlsec1_xmlSecTransformKWDes3GetKlass,                 METH_NOARGS,                NULL},
    {"transformDsaSha1GetKlass",                      (PyCFunction)xmlsec1_xmlSecTransformDsaSha1GetKlass,                METH_NOARGS,                NULL},
    {"transformDsaSha1Id",                            (PyCFunction)xmlsec1_xmlSecTransformDsaSha1GetKlass,                METH_NOARGS,                NULL},
    {"transformGost2001GostR3411_94GetKlass",         (PyCFunction)xmlsec1_xmlSecTransformGost2001GostR3411_94GetKlass,   METH_NOARGS,                NULL},
    {"transformGost2001GostR3411_94Id",               (PyCFunction)xmlsec1_xmlSecTransformGost2001GostR3411_94GetKlass,   METH_NOARGS,                NULL},
    {"transformHmacMd5GetKlass",                      (PyCFunction)xmlsec1_xmlSecTransformHmacMd5GetKlass,                METH_NOARGS,                NULL},
    {"transformHmacMd5Id",                            (PyCFunction)xmlsec1_xmlSecTransformHmacMd5GetKlass,                METH_NOARGS,                NULL},
    {"transformHmacRipemd160GetKlass",                (PyCFunction)xmlsec1_xmlSecTransformHmacRipemd160GetKlass,          METH_NOARGS,                NULL},
    {"transformHmacRipemd160Id",                      (PyCFunction)xmlsec1_xmlSecTransformHmacRipemd160GetKlass,          METH_NOARGS,                NULL},
    {"transformHmacSha1GetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformHmacSha1GetKlass,               METH_NOARGS,                NULL},
    {"transformHmacSha1Id",                           (PyCFunction)xmlsec1_xmlSecTransformHmacSha1GetKlass,               METH_NOARGS,                NULL},
    {"transformHmacSha224GetKlass",                   (PyCFunction)xmlsec1_xmlSecTransformHmacSha224GetKlass,             METH_NOARGS,                NULL},
    {"transformHmacSha224Id",                         (PyCFunction)xmlsec1_xmlSecTransformHmacSha224GetKlass,             METH_NOARGS,                NULL},
    {"transformHmacSha256GetKlass",                   (PyCFunction)xmlsec1_xmlSecTransformHmacSha256GetKlass,             METH_NOARGS,                NULL},
    {"transformHmacSha256Id",                         (PyCFunction)xmlsec1_xmlSecTransformHmacSha256GetKlass,             METH_NOARGS,                NULL},
    {"transformHmacSha384GetKlass",                   (PyCFunction)xmlsec1_xmlSecTransformHmacSha384GetKlass,             METH_NOARGS,                NULL},
    {"transformHmacSha384Id",                         (PyCFunction)xmlsec1_xmlSecTransformHmacSha384GetKlass,             METH_NOARGS,                NULL},
    {"transformHmacSha512GetKlass",                   (PyCFunction)xmlsec1_xmlSecTransformHmacSha512GetKlass,             METH_NOARGS,                NULL},
    {"transformHmacSha512Id",                         (PyCFunction)xmlsec1_xmlSecTransformHmacSha512GetKlass,             METH_NOARGS,                NULL},
    {"transformMd5GetKlass",                          (PyCFunction)xmlsec1_xmlSecTransformMd5GetKlass,                    METH_NOARGS,                NULL},
    {"transformMd5Id",                                (PyCFunction)xmlsec1_xmlSecTransformMd5GetKlass,                    METH_NOARGS,                NULL},
    {"transformRipemd160GetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformRipemd160GetKlass,              METH_NOARGS,                NULL},
    {"transformRipemd160Id",                          (PyCFunction)xmlsec1_xmlSecTransformRipemd160GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaMd5GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformRsaMd5GetKlass,                 METH_NOARGS,                NULL},
    {"transformRsaMd5Id",                             (PyCFunction)xmlsec1_xmlSecTransformRsaMd5GetKlass,                 METH_NOARGS,                NULL},
    {"transformRsaRipemd160GetKlass",                 (PyCFunction)xmlsec1_xmlSecTransformRsaRipemd160GetKlass,           METH_NOARGS,                NULL},
    {"transformRsaRipemd160Id",                       (PyCFunction)xmlsec1_xmlSecTransformRsaRipemd160GetKlass,           METH_NOARGS,                NULL},
    {"transformRsaSha1GetKlass",                      (PyCFunction)xmlsec1_xmlSecTransformRsaSha1GetKlass,                METH_NOARGS,                NULL},
    {"transformRsaSha1Id",                            (PyCFunction)xmlsec1_xmlSecTransformRsaSha1GetKlass,                METH_NOARGS,                NULL},
    {"transformRsaSha224GetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformRsaSha224GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaSha224Id",                          (PyCFunction)xmlsec1_xmlSecTransformRsaSha224GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaSha256GetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformRsaSha256GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaSha256Id",                          (PyCFunction)xmlsec1_xmlSecTransformRsaSha256GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaSha384GetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformRsaSha384GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaSha384Id",                          (PyCFunction)xmlsec1_xmlSecTransformRsaSha384GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaSha512GetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformRsaSha512GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaSha512Id",                          (PyCFunction)xmlsec1_xmlSecTransformRsaSha512GetKlass,              METH_NOARGS,                NULL},
    {"transformRsaPkcs1GetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformRsaPkcs1GetKlass,               METH_NOARGS,                NULL},
    {"transformRsaPkcs1Id",                           (PyCFunction)xmlsec1_xmlSecTransformRsaPkcs1GetKlass,               METH_NOARGS,                NULL},
    {"transformRsaOaepGetKlass",                      (PyCFunction)xmlsec1_xmlSecTransformRsaOaepGetKlass,                METH_NOARGS,                NULL},
    {"transformRsaOaepId",                            (PyCFunction)xmlsec1_xmlSecTransformRsaOaepGetKlass,                METH_NOARGS,                NULL},
    {"transformGostR3411_94GetKlass",                 (PyCFunction)xmlsec1_xmlSecTransformGostR3411_94GetKlass,           METH_NOARGS,                NULL},
    {"transformGostR3411_94Id",                       (PyCFunction)xmlsec1_xmlSecTransformGostR3411_94GetKlass,           METH_NOARGS,                NULL},
    {"transformSha1GetKlass",                         (PyCFunction)xmlsec1_xmlSecTransformSha1GetKlass,                   METH_NOARGS,                NULL},
    {"transformSha1Id",                               (PyCFunction)xmlsec1_xmlSecTransformSha1GetKlass,                   METH_NOARGS,                NULL},
    {"transformSha224GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformSha224GetKlass,                 METH_NOARGS,                NULL},
    {"transformSha224Id",                             (PyCFunction)xmlsec1_xmlSecTransformSha224GetKlass,                 METH_NOARGS,                NULL},
    {"transformSha256GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformSha256GetKlass,                 METH_NOARGS,                NULL},
    {"transformSha256Id",                             (PyCFunction)xmlsec1_xmlSecTransformSha256GetKlass,                 METH_NOARGS,                NULL},
    {"transformSha384GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformSha384GetKlass,                 METH_NOARGS,                NULL},
    {"transformSha384Id",                             (PyCFunction)xmlsec1_xmlSecTransformSha384GetKlass,                 METH_NOARGS,                NULL},
    {"transformSha512GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformSha512GetKlass,                 METH_NOARGS,                NULL},
    {"transformSha512Id",                             (PyCFunction)xmlsec1_xmlSecTransformSha512GetKlass,                 METH_NOARGS,                NULL},
    {"cryptoAppInit",                                 (PyCFunction)xmlsec1_xmlSecCryptoAppInit,                           METH_O,                     NULL},
    {"cryptoAppShutdown",                             (PyCFunction)xmlsec1_xmlSecCryptoAppShutdown,                       METH_NOARGS,                NULL},
    {"cryptoAppDefaultKeysMngrInit",                  (PyCFunction)xmlsec1_xmlSecCryptoAppDefaultKeysMngrInit,            METH_O,                     NULL},
    {"cryptoAppDefaultKeysMngrAdoptKey",              (PyCFunction)xmlsec1_xmlSecCryptoAppDefaultKeysMngrAdoptKey,        METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppDefaultKeysMngrLoad",                  (PyCFunction)xmlsec1_xmlSecCryptoAppDefaultKeysMngrLoad,            METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppDefaultKeysMngrSave",                  (PyCFunction)xmlsec1_xmlSecCryptoAppDefaultKeysMngrSave,            METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppKeysMngrCertLoad",                     (PyCFunction)xmlsec1_xmlSecCryptoAppKeysMngrCertLoad,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppKeysMngrCertLoadMemory",               (PyCFunction)xmlsec1_xmlSecCryptoAppKeysMngrCertLoadMemory,         METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppKeyLoad",                              (PyCFunction)xmlsec1_xmlSecCryptoAppKeyLoad,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppKeyLoadMemory",                        (PyCFunction)xmlsec1_xmlSecCryptoAppKeyLoadMemory,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppPkcs12Load",                           (PyCFunction)xmlsec1_xmlSecCryptoAppPkcs12Load,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppPkcs12LoadMemory",                     (PyCFunction)xmlsec1_xmlSecCryptoAppPkcs12LoadMemory,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppKeyCertLoad",                          (PyCFunction)xmlsec1_xmlSecCryptoAppKeyCertLoad,                    METH_VARARGS|METH_KEYWORDS, NULL},
    {"cryptoAppKeyCertLoadMemory",                    (PyCFunction)xmlsec1_xmlSecCryptoAppKeyCertLoadMemory,              METH_VARARGS|METH_KEYWORDS, NULL},
    /* base64 */
    {"base64SetDefaultLineSize",                      (PyCFunction)xmlsec1_xmlSecBase64SetDefaultLineSize,                METH_VARARGS|METH_KEYWORDS, NULL},
    {"base64GetDefaultLineSize",                      (PyCFunction)xmlsec1_xmlSecBase64GetDefaultLineSize,                METH_NOARGS,                NULL},
    {"base64CtxCreate",                               (PyCFunction)xmlsec1_xmlSecBase64CtxCreate,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"base64CtxDestroy",                              (PyCFunction)xmlsec1_xmlSecBase64CtxDestroy,                        METH_O,                     NULL},
    {"base64CtxInitialize",                           (PyCFunction)xmlsec1_xmlSecBase64CtxInitialize,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"base64CtxFinalize",                             (PyCFunction)xmlsec1_xmlSecBase64CtxFinalize,                       METH_O,                     NULL},
    {"base64CtxUpdate",                               (PyCFunction)xmlsec1_xmlSecBase64CtxUpdate,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"base64CtxFinal",                                (PyCFunction)xmlsec1_xmlSecBase64CtxFinal,                          METH_O,                     NULL},
    {"base64Encode",                                  (PyCFunction)xmlsec1_xmlSecBase64Encode,                            METH_VARARGS|METH_KEYWORDS, NULL},
    {"base64Decode",                                  (PyCFunction)xmlsec1_xmlSecBase64Decode,                            METH_O,                     NULL},
    /* bn */
    {"bnCreate",                                      (PyCFunction)xmlsec1_xmlSecBnCreate,                                METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnDestroy",                                     (PyCFunction)xmlsec1_xmlSecBnDestroy,                               METH_O,                     NULL},
    {"bnInitialize",                                  (PyCFunction)xmlsec1_xmlSecBnInitialize,                            METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnFinalize",                                    (PyCFunction)xmlsec1_xmlSecBnFinalize,                              METH_O,                     NULL},
    {"bnGetSize",                                     (PyCFunction)xmlsec1_xmlSecBnGetSize,                               METH_O,                     NULL},
    {"bnZero",                                        (PyCFunction)xmlsec1_xmlSecBnZero,                                  METH_O,                     NULL},
    {"bnSetData",                                     (PyCFunction)xmlsec1_xmlSecBnSetData,                               METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnGetData",                                     (PyCFunction)xmlsec1_xmlSecBnGetData,                               METH_O,                     NULL},
    {"bnReverse",                                     (PyCFunction)xmlsec1_xmlSecBnReverse,                               METH_O,                     NULL},
    {"bnFromString",                                  (PyCFunction)xmlsec1_xmlSecBnFromString,                            METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnToString",                                    (PyCFunction)xmlsec1_xmlSecBnToString,                              METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnFromHexString",                               (PyCFunction)xmlsec1_xmlSecBnFromHexString,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnToHexString",                                 (PyCFunction)xmlsec1_xmlSecBnToHexString,                           METH_O,                     NULL},
    {"bnFromDecString",                               (PyCFunction)xmlsec1_xmlSecBnFromDecString,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnToDecString",                                 (PyCFunction)xmlsec1_xmlSecBnToDecString,                           METH_O,                     NULL},
    {"bnMul",                                         (PyCFunction)xmlsec1_xmlSecBnMul,                                   METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnDiv",                                         (PyCFunction)xmlsec1_xmlSecBnDiv,                                   METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnAdd",                                         (PyCFunction)xmlsec1_xmlSecBnAdd,                                   METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnCompare",                                     (PyCFunction)xmlsec1_xmlSecBnCompare,                               METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnCompareReverse",                              (PyCFunction)xmlsec1_xmlSecBnCompareReverse,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnGetNodeValue",                                (PyCFunction)xmlsec1_xmlSecBnGetNodeValue,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnSetNodeValue",                                (PyCFunction)xmlsec1_xmlSecBnSetNodeValue,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"bnBlobSetNodeValue",                            (PyCFunction)xmlsec1_xmlSecBnBlobSetNodeValue,                      METH_VARARGS|METH_KEYWORDS, NULL},
    /* buffer */
    {"bufferSetDefaultAllocMode",                     (PyCFunction)xmlsec1_xmlSecBufferSetDefaultAllocMode,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferCreate",                                  (PyCFunction)xmlsec1_xmlSecBufferCreate,                            METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferDestroy",                                 (PyCFunction)xmlsec1_xmlSecBufferDestroy,                           METH_O,                     NULL},
    {"bufferInitialize",                              (PyCFunction)xmlsec1_xmlSecBufferInitialize,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferFinalize",                                (PyCFunction)xmlsec1_xmlSecBufferFinalize,                          METH_O,                     NULL},
    {"bufferGetData",                                 (PyCFunction)xmlsec1_xmlSecBufferGetData,                           METH_O,                     NULL},
    {"bufferSetData",                                 (PyCFunction)xmlsec1_xmlSecBufferSetData,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferGetSize",                                 (PyCFunction)xmlsec1_xmlSecBufferGetSize,                           METH_O,                     NULL},
    {"bufferSetSize",                                 (PyCFunction)xmlsec1_xmlSecBufferSetSize,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferGetMaxSize",                              (PyCFunction)xmlsec1_xmlSecBufferGetMaxSize,                        METH_O,                     NULL},
    {"bufferEmpty",                                   (PyCFunction)xmlsec1_xmlSecBufferEmpty,                             METH_O,                     NULL},
    {"bufferRemoveHead",                              (PyCFunction)xmlsec1_xmlSecBufferRemoveHead,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferRemoveTail",                              (PyCFunction)xmlsec1_xmlSecBufferRemoveTail,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferAppend",                                  (PyCFunction)xmlsec1_xmlSecBufferAppend,                            METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferPrepend",                                 (PyCFunction)xmlsec1_xmlSecBufferPrepend,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferReadFile",                                (PyCFunction)xmlsec1_xmlSecBufferReadFile,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferBase64NodeContentRead",                   (PyCFunction)xmlsec1_xmlSecBufferBase64NodeContentRead,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferBase64NodeContentWrite",                  (PyCFunction)xmlsec1_xmlSecBufferBase64NodeContentWrite,            METH_VARARGS|METH_KEYWORDS, NULL},
    {"bufferCreateOutputBuffer",                      (PyCFunction)xmlsec1_xmlSecBufferCreateOutputBuffer,                METH_O,                     NULL},
    /* dl */
    {"cryptoDLFunctionsRegisterKeyDataAndTransforms", (PyCFunction)xmlsec1_xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms, METH_O,                     NULL},
    {"cryptoDLInit",                                  (PyCFunction)xmlsec1_xmlSecCryptoDLInit,                            METH_NOARGS,                NULL},
    {"cryptoDLShutdown",                              (PyCFunction)xmlsec1_xmlSecCryptoDLShutdown,                        METH_NOARGS,                NULL},
    {"cryptoDLLoadLibrary",                           (PyCFunction)xmlsec1_xmlSecCryptoDLLoadLibrary,                     METH_O,                     NULL},
    {"cryptoDLGetLibraryFunctions",                   (PyCFunction)xmlsec1_xmlSecCryptoDLGetLibraryFunctions,             METH_O,                     NULL},
    {"cryptoDLUnloadLibrary",                         (PyCFunction)xmlsec1_xmlSecCryptoDLUnloadLibrary,                   METH_O,                     NULL},
    {"cryptoDLSetFunctions",                          (PyCFunction)xmlsec1_xmlSecCryptoDLSetFunctions,                    METH_O,                     NULL},
    {"cryptoDLGetFunctions",                          (PyCFunction)xmlsec1_xmlSecCryptoDLGetFunctions,                    METH_NOARGS,                NULL},
    /* errors */
    /* io */
    /* keyinfo */
    {"keyInfoNodeRead",                               (PyCFunction)xmlsec1_xmlSecKeyInfoNodeRead,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyInfoNodeWrite",                              (PyCFunction)xmlsec1_xmlSecKeyInfoNodeWrite,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyInfoCtxCreate",                              (PyCFunction)xmlsec1_xmlSecKeyInfoCtxCreate,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyInfoCtxDestroy",                             (PyCFunction)xmlsec1_xmlSecKeyInfoCtxDestroy,                       METH_O,                     NULL},
    {"keyInfoCtxInitialize",                          (PyCFunction)xmlsec1_xmlSecKeyInfoCtxInitialize,                    METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyInfoCtxFinalize",                            (PyCFunction)xmlsec1_xmlSecKeyInfoCtxFinalize,                      METH_O,                     NULL},
    {"keyInfoCtxReset",                               (PyCFunction)xmlsec1_xmlSecKeyInfoCtxReset,                         METH_O,                     NULL},
    {"keyInfoCtxCopyUserPref",                        (PyCFunction)xmlsec1_xmlSecKeyInfoCtxCopyUserPref,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyInfoCtxCreateEncCtx",                        (PyCFunction)xmlsec1_xmlSecKeyInfoCtxCreateEncCtx,                  METH_O,                     NULL},
    {"keyInfoCtxDebugDump",                           (PyCFunction)xmlsec1_xmlSecKeyInfoCtxDebugDump,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyInfoCtxDebugXmlDump",                        (PyCFunction)xmlsec1_xmlSecKeyInfoCtxDebugXmlDump,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataNameId",                                 (PyCFunction)xmlsec1_xmlSecKeyDataNameGetKlass,                     METH_NOARGS,                NULL},
    {"keyDataNameGetKlass",                           (PyCFunction)xmlsec1_xmlSecKeyDataNameGetKlass,                     METH_NOARGS,                NULL},
    {"keyDataValueId",                                (PyCFunction)xmlsec1_xmlSecKeyDataValueGetKlass,                    METH_NOARGS,                NULL},
    {"keyDataValueGetKlass",                          (PyCFunction)xmlsec1_xmlSecKeyDataValueGetKlass,                    METH_NOARGS,                NULL},
    {"keyDataRetrievalMethodId",                      (PyCFunction)xmlsec1_xmlSecKeyDataRetrievalMethodGetKlass,          METH_NOARGS,                NULL},
    {"keyDataRetrievalMethodGetKlass",                (PyCFunction)xmlsec1_xmlSecKeyDataRetrievalMethodGetKlass,          METH_NOARGS,                NULL},
    {"keyDataEncryptedKeyId",                         (PyCFunction)xmlsec1_xmlSecKeyDataEncryptedKeyGetKlass,             METH_NOARGS,                NULL},
    {"keyDataEncryptedKeyGetKlass",                   (PyCFunction)xmlsec1_xmlSecKeyDataEncryptedKeyGetKlass,             METH_NOARGS,                NULL},
    /* keysdata */
    {"keyDataIdsGet",                                 (PyCFunction)xmlsec1_xmlSecKeyDataIdsGet,                           METH_NOARGS,                NULL},
    {"keyDataIdsInit",                                (PyCFunction)xmlsec1_xmlSecKeyDataIdsInit,                          METH_NOARGS,                NULL},
    {"keyDataIdsShutdown",                            (PyCFunction)xmlsec1_xmlSecKeyDataIdsShutdown,                      METH_NOARGS,                NULL},
    {"keyDataIdsRegisterDefault",                     (PyCFunction)xmlsec1_xmlSecKeyDataIdsRegisterDefault,               METH_NOARGS,                NULL},
    {"keyDataIdsRegister",                            (PyCFunction)xmlsec1_xmlSecKeyDataIdsRegister,                      METH_O,                     NULL},
    {"keyDataCreate",                                 (PyCFunction)xmlsec1_xmlSecKeyDataCreate,                           METH_O,                     NULL},
    {"keyDataDuplicate",                              (PyCFunction)xmlsec1_xmlSecKeyDataDuplicate,                        METH_O,                     NULL},
    {"keyDataDestroy",                                (PyCFunction)xmlsec1_xmlSecKeyDataDestroy,                          METH_O,                     NULL},
    {"keyDataGenerate",                               (PyCFunction)xmlsec1_xmlSecKeyDataGenerate,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataGetType",                                (PyCFunction)xmlsec1_xmlSecKeyDataGetType,                          METH_O,                     NULL},
    {"keyDataGetSize",                                (PyCFunction)xmlsec1_xmlSecKeyDataGetSize,                          METH_O,                     NULL},
    {"keyDataGetIdentifier",                          (PyCFunction)xmlsec1_xmlSecKeyDataGetIdentifier,                    METH_O,                     NULL},
    {"keyDataDebugDump",                              (PyCFunction)xmlsec1_xmlSecKeyDataDebugDump,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataDebugXmlDump",                           (PyCFunction)xmlsec1_xmlSecKeyDataDebugXmlDump,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataXmlRead",                                (PyCFunction)xmlsec1_xmlSecKeyDataXmlRead,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataXmlWrite",                               (PyCFunction)xmlsec1_xmlSecKeyDataXmlWrite,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinRead",                                (PyCFunction)xmlsec1_xmlSecKeyDataBinRead,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinWrite",                               (PyCFunction)xmlsec1_xmlSecKeyDataBinWrite,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataGetName",                                (PyCFunction)xmlsec1_xmlSecKeyDataGetName,                          METH_O,                     NULL},
    {"keyDataIsValid",                                (PyCFunction)xmlsec1_xmlSecKeyDataIsValid,                          METH_O,                     NULL},
    {"keyDataCheckId",                                (PyCFunction)xmlsec1_xmlSecKeyDataCheckId,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataCheckUsage",                             (PyCFunction)xmlsec1_xmlSecKeyDataCheckUsage,                       METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataCheckSize",                              (PyCFunction)xmlsec1_xmlSecKeyDataCheckSize,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataKlassGetName",                           (PyCFunction)xmlsec1_xmlSecKeyDataKlassGetName,                     METH_O,                     NULL},
    {"keyDataListGetKlass",                           (PyCFunction)xmlsec1_xmlSecKeyDataListGetKlass,                     METH_NOARGS,                NULL},
    {"keyDataListId",                                 (PyCFunction)xmlsec1_xmlSecKeyDataListGetKlass,                     METH_NOARGS,                NULL},
    {"keyDataIdListGetKlass",                         (PyCFunction)xmlsec1_xmlSecKeyDataIdListGetKlass,                   METH_NOARGS,                NULL},
    {"keyDataIdListId",                               (PyCFunction)xmlsec1_xmlSecKeyDataIdListGetKlass,                   METH_NOARGS,                NULL},
    {"keyDataIdListFind",                             (PyCFunction)xmlsec1_xmlSecKeyDataIdListFind,                       METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataIdListFindByNode",                       (PyCFunction)xmlsec1_xmlSecKeyDataIdListFindByNode,                 METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataIdListFindByHref",                       (PyCFunction)xmlsec1_xmlSecKeyDataIdListFindByHref,                 METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataIdListFindByName",                       (PyCFunction)xmlsec1_xmlSecKeyDataIdListFindByName,                 METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataIdListDebugDump",                        (PyCFunction)xmlsec1_xmlSecKeyDataIdListDebugDump,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataIdListDebugXmlDump",                     (PyCFunction)xmlsec1_xmlSecKeyDataIdListDebugXmlDump,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueInitialize",                  (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueInitialize,            METH_O,                     NULL},
    {"keyDataBinaryValueDuplicate",                   (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueDuplicate,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueFinalize",                    (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueFinalize,              METH_O,                     NULL},
    {"keyDataBinaryValueXmlRead",                     (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueXmlRead,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueXmlWrite",                    (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueXmlWrite,              METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueBinRead",                     (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueBinRead,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueBinWrite",                    (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueBinWrite,              METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueDebugDump",                   (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueDebugDump,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueDebugXmlDump",                (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueDebugXmlDump,          METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataBinaryValueGetSize",                     (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueGetSize,               METH_O,                     NULL},
    {"keyDataBinaryValueGetBuffer",                   (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueGetBuffer,             METH_O,                     NULL},
    {"keyDataBinaryValueSetBuffer",                   (PyCFunction)xmlsec1_xmlSecKeyDataBinaryValueSetBuffer,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataStoreCreate",                            (PyCFunction)xmlsec1_xmlSecKeyDataStoreCreate,                      METH_O,                     NULL},
    {"keyDataStoreDestroy",                           (PyCFunction)xmlsec1_xmlSecKeyDataStoreDestroy,                     METH_O,                     NULL},
    {"keyDataStoreGetName",                           (PyCFunction)xmlsec1_xmlSecKeyDataStoreGetName,                     METH_O,                     NULL},
    {"keyDataStoreIsValid",                           (PyCFunction)xmlsec1_xmlSecKeyDataStoreIsValid,                     METH_O,                     NULL},
    {"keyDataStoreCheckId",                           (PyCFunction)xmlsec1_xmlSecKeyDataStoreCheckId,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataStoreCheckSize",                         (PyCFunction)xmlsec1_xmlSecKeyDataStoreCheckSize,                   METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDataStoreKlassGetName",                      (PyCFunction)xmlsec1_xmlSecKeyDataStoreKlassGetName,                METH_O,                     NULL},
    {"keyDataStorePtrListGetKlass",                   (PyCFunction)xmlsec1_xmlSecKeyDataStorePtrListGetKlass,             METH_NOARGS,                NULL},
    {"keyDataStorePtrListId",                         (PyCFunction)xmlsec1_xmlSecKeyDataStorePtrListGetKlass,             METH_NOARGS,                NULL},
    /* keys */
    {"keyUseWithInitialize",                          (PyCFunction)xmlsec1_xmlSecKeyUseWithInitialize,                    METH_O,                     NULL},
    {"keyUseWithFinalize",                            (PyCFunction)xmlsec1_xmlSecKeyUseWithFinalize,                      METH_O,                     NULL},
    {"keyUseWithReset",                               (PyCFunction)xmlsec1_xmlSecKeyUseWithReset,                         METH_O,                     NULL},
    {"keyUseWithCopy",                                (PyCFunction)xmlsec1_xmlSecKeyUseWithCopy,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyUseWithCreate",                              (PyCFunction)xmlsec1_xmlSecKeyUseWithCreate,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyUseWithDuplicate",                           (PyCFunction)xmlsec1_xmlSecKeyUseWithDuplicate,                     METH_O,                     NULL},
    {"keyUseWithDestroy",                             (PyCFunction)xmlsec1_xmlSecKeyUseWithDestroy,                       METH_O,                     NULL},
    {"keyUseWithSet",                                 (PyCFunction)xmlsec1_xmlSecKeyUseWithSet,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyUseWithDebugDump",                           (PyCFunction)xmlsec1_xmlSecKeyUseWithDebugDump,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyUseWithDebugXmlDump",                        (PyCFunction)xmlsec1_xmlSecKeyUseWithDebugXmlDump,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyUseWithPtrListGetKlass",                     (PyCFunction)xmlsec1_xmlSecKeyUseWithPtrListGetKlass,               METH_NOARGS,                NULL},
    {"keyUseWithPtrListId",                           (PyCFunction)xmlsec1_xmlSecKeyUseWithPtrListGetKlass,               METH_NOARGS,                NULL},
    {"keyReqInitialize",                              (PyCFunction)xmlsec1_xmlSecKeyReqInitialize,                        METH_O,                     NULL},
    {"keyReqFinalize",                                (PyCFunction)xmlsec1_xmlSecKeyReqFinalize,                          METH_O,                     NULL},
    {"keyReqReset",                                   (PyCFunction)xmlsec1_xmlSecKeyReqReset,                             METH_O,                     NULL},
    {"keyReqCopy",                                    (PyCFunction)xmlsec1_xmlSecKeyReqCopy,                              METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyReqMatchKey",                                (PyCFunction)xmlsec1_xmlSecKeyReqMatchKey,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyReqMatchKeyValue",                           (PyCFunction)xmlsec1_xmlSecKeyReqMatchKeyValue,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyReqDebugDump",                               (PyCFunction)xmlsec1_xmlSecKeyReqDebugDump,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyReqDebugXmlDump",                            (PyCFunction)xmlsec1_xmlSecKeyReqDebugXmlDump,                      METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyCreate",                                     (PyCFunction)xmlsec1_xmlSecKeyCreate,                               METH_NOARGS,                NULL},
    {"keyDestroy",                                    (PyCFunction)xmlsec1_xmlSecKeyDestroy,                              METH_O,                     NULL},
    {"keyEmpty",                                      (PyCFunction)xmlsec1_xmlSecKeyEmpty,                                METH_O,                     NULL},
    {"keyDuplicate",                                  (PyCFunction)xmlsec1_xmlSecKeyDuplicate,                            METH_O,                     NULL},
    {"keyCopy",                                       (PyCFunction)xmlsec1_xmlSecKeyCopy,                                 METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyGetName",                                    (PyCFunction)xmlsec1_xmlSecKeyGetName,                              METH_O,                     NULL},
    {"keySetName",                                    (PyCFunction)xmlsec1_xmlSecKeySetName,                              METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyGetType",                                    (PyCFunction)xmlsec1_xmlSecKeyGetType,                              METH_O,                     NULL},
    {"keyGetValue",                                   (PyCFunction)xmlsec1_xmlSecKeyGetValue,                             METH_O,                     NULL},
    {"keySetValue",                                   (PyCFunction)xmlsec1_xmlSecKeySetValue,                             METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyGetData",                                    (PyCFunction)xmlsec1_xmlSecKeyGetData,                              METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyEnsureData",                                 (PyCFunction)xmlsec1_xmlSecKeyEnsureData,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyAdoptData",                                  (PyCFunction)xmlsec1_xmlSecKeyAdoptData,                            METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDebugDump",                                  (PyCFunction)xmlsec1_xmlSecKeyDebugDump,                            METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyDebugXmlDump",                               (PyCFunction)xmlsec1_xmlSecKeyDebugXmlDump,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyGenerate",                                   (PyCFunction)xmlsec1_xmlSecKeyGenerate,                             METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyGenerateByName",                             (PyCFunction)xmlsec1_xmlSecKeyGenerateByName,                       METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyMatch",                                      (PyCFunction)xmlsec1_xmlSecKeyMatch,                                METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyReadBuffer",                                 (PyCFunction)xmlsec1_xmlSecKeyReadBuffer,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyReadBinaryFile",                             (PyCFunction)xmlsec1_xmlSecKeyReadBinaryFile,                       METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyReadMemory",                                 (PyCFunction)xmlsec1_xmlSecKeyReadMemory,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyIsValid",                                    (PyCFunction)xmlsec1_xmlSecKeyIsValid,                              METH_O,                     NULL},
    {"keyCheckId",                                    (PyCFunction)xmlsec1_xmlSecKeyCheckId,                              METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyPtrListGetKlass",                            (PyCFunction)xmlsec1_xmlSecKeyPtrListGetKlass,                      METH_NOARGS,                NULL},
    {"keyPtrListId",                                  (PyCFunction)xmlsec1_xmlSecKeyPtrListGetKlass,                      METH_NOARGS,                NULL},
    /* keysmngr */
    {"keysMngrCreate",                                (PyCFunction)xmlsec1_xmlSecKeysMngrCreate,                          METH_NOARGS,                NULL},
    {"keysMngrDestroy",                               (PyCFunction)xmlsec1_xmlSecKeysMngrDestroy,                         METH_O,                     NULL},
    {"keysMngrFindKey",                               (PyCFunction)xmlsec1_xmlSecKeysMngrFindKey,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keysMngrAdoptKeysStore",                        (PyCFunction)xmlsec1_xmlSecKeysMngrAdoptKeysStore,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"keysMngrGetKeysStore",                          (PyCFunction)xmlsec1_xmlSecKeysMngrGetKeysStore,                    METH_O,                     NULL},
    {"keysMngrAdoptDataStore",                        (PyCFunction)xmlsec1_xmlSecKeysMngrAdoptDataStore,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"keysMngrGetDataStore",                          (PyCFunction)xmlsec1_xmlSecKeysMngrGetDataStore,                    METH_VARARGS|METH_KEYWORDS, NULL},
    {"keysMngrGetKey",                                (PyCFunction)xmlsec1_xmlSecKeysMngrGetKey,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyStoreCreate",                                (PyCFunction)xmlsec1_xmlSecKeyStoreCreate,                          METH_O,                     NULL},
    {"keyStoreDestroy",                               (PyCFunction)xmlsec1_xmlSecKeyStoreDestroy,                         METH_O,                     NULL},
    {"keyStoreFindKey",                               (PyCFunction)xmlsec1_xmlSecKeyStoreFindKey,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyStoreGetName",                               (PyCFunction)xmlsec1_xmlSecKeyStoreGetName,                         METH_O,                     NULL},
    {"keyStoreIsValid",                               (PyCFunction)xmlsec1_xmlSecKeyStoreIsValid,                         METH_O,                     NULL},
    {"keyStoreCheckId",                               (PyCFunction)xmlsec1_xmlSecKeyStoreCheckId,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyStoreCheckSize",                             (PyCFunction)xmlsec1_xmlSecKeyStoreCheckSize,                       METH_VARARGS|METH_KEYWORDS, NULL},
    {"keyStoreKlassGetName",                          (PyCFunction)xmlsec1_xmlSecKeyStoreKlassGetName,                    METH_O,                     NULL},
    {"simpleKeysStoreGetKlass",                       (PyCFunction)xmlsec1_xmlSecSimpleKeysStoreGetKlass,                 METH_NOARGS,                NULL},
    {"simpleKeysStoreId",                             (PyCFunction)xmlsec1_xmlSecSimpleKeysStoreGetKlass,                 METH_NOARGS,                NULL},
    {"simpleKeysStoreAdoptKey",                       (PyCFunction)xmlsec1_xmlSecSimpleKeysStoreAdoptKey,                 METH_VARARGS|METH_KEYWORDS, NULL},
    {"simpleKeysStoreLoad",                           (PyCFunction)xmlsec1_xmlSecSimpleKeysStoreLoad,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"simpleKeysStoreSave",                           (PyCFunction)xmlsec1_xmlSecSimpleKeysStoreSave,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"simpleKeysStoreGetKeys",                        (PyCFunction)xmlsec1_xmlSecSimpleKeysStoreGetKeys,                  METH_O,                     NULL},
    /* list */
    {"stringListGetKlass",                            (PyCFunction)xmlsec1_xmlSecStringListGetKlass,                      METH_NOARGS,                NULL},
    {"stringListId",                                  (PyCFunction)xmlsec1_xmlSecStringListGetKlass,                      METH_NOARGS,                NULL},
    {"strListCreate",                                 (PyCFunction)xmlsec1_xmlSecPtrListCreate,                           METH_O,                     NULL},
    {"strListDestroy",                                (PyCFunction)xmlsec1_xmlSecPtrListDestroy,                          METH_O,                     NULL},
    {"strListInitialize",                             (PyCFunction)xmlsec1_xmlSecPtrListInitialize,                       METH_VARARGS|METH_KEYWORDS, NULL},
    /* membuf */
    {"transformMemBufGetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformMemBufGetKlass,                 METH_NOARGS,                NULL},
    {"transformMemBufId",                             (PyCFunction)xmlsec1_xmlSecTransformMemBufGetKlass,                 METH_NOARGS,                NULL},
    {"transformMemBufGetBuffer",                      (PyCFunction)xmlsec1_xmlSecTransformMemBufGetBuffer,                METH_O,                     NULL},
    /* nodeset */
    {"nodeSetCreate",                                 (PyCFunction)xmlsec1_xmlSecNodeSetCreate,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"nodeSetDestroy",                                (PyCFunction)xmlsec1_xmlSecNodeSetDestroy,                          METH_O,                     NULL},
    {"nodeSetDocDestroy",                             (PyCFunction)xmlsec1_xmlSecNodeSetDocDestroy,                       METH_O,                     NULL},
    {"nodeSetContains",                               (PyCFunction)xmlsec1_xmlSecNodeSetContains,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"nodeSetAdd",                                    (PyCFunction)xmlsec1_xmlSecNodeSetAdd,                              METH_VARARGS|METH_KEYWORDS, NULL},
    {"nodeSetAddList",                                (PyCFunction)xmlsec1_xmlSecNodeSetAddList,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"nodeSetGetChildren",                            (PyCFunction)xmlsec1_xmlSecNodeSetGetChildren,                      METH_VARARGS|METH_KEYWORDS, NULL},
    {"nodeSetWalk",                                   (PyCFunction)xmlsec1_xmlSecNodeSetWalk,                             METH_VARARGS|METH_KEYWORDS, NULL},
    {"nodeSetDumpTextNodes",                          (PyCFunction)xmlsec1_xmlSecNodeSetDumpTextNodes,                    METH_VARARGS|METH_KEYWORDS, NULL},
    {"nodeSetDebugDump",                              (PyCFunction)xmlsec1_xmlSecNodeSetDebugDump,                        METH_VARARGS|METH_KEYWORDS, NULL},
    /* parser */
    {"parseFile",                                     (PyCFunction)xmlsec1_xmlSecParseFile,                               METH_VARARGS|METH_KEYWORDS, NULL},
    {"parseMemory",                                   (PyCFunction)xmlsec1_xmlSecParseMemory,                             METH_VARARGS|METH_KEYWORDS, NULL},
    {"parseMemoryExt",                                (PyCFunction)xmlsec1_xmlSecParseMemoryExt,                          METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformXmlParserGetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformXmlParserGetKlass,              METH_NOARGS,                NULL},
    {"transformXmlParserId",                          (PyCFunction)xmlsec1_xmlSecTransformXmlParserGetKlass,              METH_NOARGS,                NULL},
    /* templates */

    /* transforms */
    {"transformIdsGet",                               (PyCFunction)xmlsec1_xmlSecTransformIdsGet,                         METH_NOARGS,                NULL},
    {"transformIdsInit",                              (PyCFunction)xmlsec1_xmlSecTransformIdsInit,                        METH_NOARGS,                NULL},
    {"transformIdsShutdown",                          (PyCFunction)xmlsec1_xmlSecTransformIdsShutdown,                    METH_NOARGS,                NULL},
    {"transformIdsRegisterDefault",                   (PyCFunction)xmlsec1_xmlSecTransformIdsRegisterDefault,             METH_NOARGS,                NULL},
    {"transformIdsRegister",                          (PyCFunction)xmlsec1_xmlSecTransformIdsRegister,                    METH_O,                     NULL},
    {"transformUriTypeCheck",                         (PyCFunction)xmlsec1_xmlSecTransformUriTypeCheck,                   METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxCreate",                            (PyCFunction)xmlsec1_xmlSecTransformCtxCreate,                      METH_NOARGS,                NULL},
    {"transformCtxDestroy",                           (PyCFunction)xmlsec1_xmlSecTransformCtxDestroy,                     METH_O,                     NULL},
    {"transformCtxInitialize",                        (PyCFunction)xmlsec1_xmlSecTransformCtxInitialize,                  METH_O,                     NULL},
    {"transformCtxFinalize",                          (PyCFunction)xmlsec1_xmlSecTransformCtxFinalize,                    METH_O,                     NULL},
    {"transformCtxReset",                             (PyCFunction)xmlsec1_xmlSecTransformCtxReset,                       METH_O,                     NULL},
    {"transformCtxCopyUserPref",                      (PyCFunction)xmlsec1_xmlSecTransformCtxCopyUserPref,                METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxSetUri",                            (PyCFunction)xmlsec1_xmlSecTransformCtxSetUri,                      METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxAppend",                            (PyCFunction)xmlsec1_xmlSecTransformCtxAppend,                      METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxPrepend",                           (PyCFunction)xmlsec1_xmlSecTransformCtxPrepend,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxCreateAndAppend",                   (PyCFunction)xmlsec1_xmlSecTransformCtxCreateAndAppend,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxCreateAndPrepend",                  (PyCFunction)xmlsec1_xmlSecTransformCtxCreateAndPrepend,            METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxNodeRead",                          (PyCFunction)xmlsec1_xmlSecTransformCtxNodeRead,                    METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxNodesListRead",                     (PyCFunction)xmlsec1_xmlSecTransformCtxNodesListRead,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxPrepare",                           (PyCFunction)xmlsec1_xmlSecTransformCtxPrepare,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxBinaryExecute",                     (PyCFunction)xmlsec1_xmlSecTransformCtxBinaryExecute,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxUriExecute",                        (PyCFunction)xmlsec1_xmlSecTransformCtxUriExecute,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxXmlExecute",                        (PyCFunction)xmlsec1_xmlSecTransformCtxXmlExecute,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxExecute",                           (PyCFunction)xmlsec1_xmlSecTransformCtxExecute,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxDebugDump",                         (PyCFunction)xmlsec1_xmlSecTransformCtxDebugDump,                   METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCtxDebugXmlDump",                      (PyCFunction)xmlsec1_xmlSecTransformCtxDebugXmlDump,                METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCreate",                               (PyCFunction)xmlsec1_xmlSecTransformCreate,                         METH_O,                     NULL},
    {"transformDestroy",                              (PyCFunction)xmlsec1_xmlSecTransformDestroy,                        METH_O,                     NULL},
    {"transformNodeRead",                             (PyCFunction)xmlsec1_xmlSecTransformNodeRead,                       METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformPump",                                 (PyCFunction)xmlsec1_xmlSecTransformPump,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformSetKey",                               (PyCFunction)xmlsec1_xmlSecTransformSetKey,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformSetKeyReq",                            (PyCFunction)xmlsec1_xmlSecTransformSetKeyReq,                      METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformVerify",                               (PyCFunction)xmlsec1_xmlSecTransformVerify,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformVerifyNodeContent",                    (PyCFunction)xmlsec1_xmlSecTransformVerifyNodeContent,              METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformGetDataType",                          (PyCFunction)xmlsec1_xmlSecTransformGetDataType,                    METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformPushBin",                              (PyCFunction)xmlsec1_xmlSecTransformPushBin,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformPopBin",                               (PyCFunction)xmlsec1_xmlSecTransformPopBin,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformPushXml",                              (PyCFunction)xmlsec1_xmlSecTransformPushXml,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformPopXml",                               (PyCFunction)xmlsec1_xmlSecTransformPopXml,                         METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformExecute",                              (PyCFunction)xmlsec1_xmlSecTransformExecute,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformDebugDump",                            (PyCFunction)xmlsec1_xmlSecTransformDebugDump,                      METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformDebugXmlDump",                         (PyCFunction)xmlsec1_xmlSecTransformDebugXmlDump,                   METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformGetName",                              (PyCFunction)xmlsec1_xmlSecTransformGetName,                        METH_O,                     NULL},
    {"transformIsValid",                              (PyCFunction)xmlsec1_xmlSecTransformIsValid,                        METH_O,                     NULL},
    {"transformCheckId",                              (PyCFunction)xmlsec1_xmlSecTransformCheckId,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCheckSize",                            (PyCFunction)xmlsec1_xmlSecTransformCheckSize,                      METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformConnect",                              (PyCFunction)xmlsec1_xmlSecTransformConnect,                        METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformRemove",                               (PyCFunction)xmlsec1_xmlSecTransformRemove,                         METH_O,                     NULL},
    {"transformDefaultGetDataType",                   (PyCFunction)xmlsec1_xmlSecTransformDefaultGetDataType,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformDefaultPushBin",                       (PyCFunction)xmlsec1_xmlSecTransformDefaultPushBin,                 METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformDefaultPopBin",                        (PyCFunction)xmlsec1_xmlSecTransformDefaultPopBin,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformDefaultPushXml",                       (PyCFunction)xmlsec1_xmlSecTransformDefaultPushXml,                 METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformDefaultPopXml",                        (PyCFunction)xmlsec1_xmlSecTransformDefaultPopXml,                  METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCreateOutputBuffer",                   (PyCFunction)xmlsec1_xmlSecTransformCreateOutputBuffer,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformCreateInputBuffer",                    (PyCFunction)xmlsec1_xmlSecTransformCreateInputBuffer,              METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformKlassGetName",                         (PyCFunction)xmlsec1_xmlSecTransformKlassGetName,                   METH_O,                     NULL},
    {"transformIdListGetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformIdListGetKlass,                 METH_NOARGS,                NULL},
    {"transformIdListId",                             (PyCFunction)xmlsec1_xmlSecTransformIdListGetKlass,                 METH_NOARGS,                NULL},
    {"transformIdListFind",                           (PyCFunction)xmlsec1_xmlSecTransformIdListFind,                     METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformIdListFindByHref",                     (PyCFunction)xmlsec1_xmlSecTransformIdListFindByHref,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformIdListFindByName",                     (PyCFunction)xmlsec1_xmlSecTransformIdListFindByName,               METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformIdListDebugDump",                      (PyCFunction)xmlsec1_xmlSecTransformIdListDebugDump,                METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformIdListDebugXmlDump",                   (PyCFunction)xmlsec1_xmlSecTransformIdListDebugXmlDump,             METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformBase64GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformBase64GetKlass,                 METH_NOARGS,                NULL},
    {"transformBase64Id",                             (PyCFunction)xmlsec1_xmlSecTransformBase64GetKlass,                 METH_NOARGS,                NULL},
    {"transformBase64SetLineSize",                    (PyCFunction)xmlsec1_xmlSecTransformBase64SetLineSize,              METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformInclC14NGetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformInclC14NGetKlass,               METH_NOARGS,                NULL},
    {"transformInclC14NId",                           (PyCFunction)xmlsec1_xmlSecTransformInclC14NGetKlass,               METH_NOARGS,                NULL},
    {"transformInclC14NWithCommentsGetKlass",         (PyCFunction)xmlsec1_xmlSecTransformInclC14NWithCommentsGetKlass,   METH_NOARGS,                NULL},
    {"transformInclC14NWithCommentsId",               (PyCFunction)xmlsec1_xmlSecTransformInclC14NWithCommentsGetKlass,   METH_NOARGS,                NULL},
    {"transformInclC14N11GetKlass",                   (PyCFunction)xmlsec1_xmlSecTransformInclC14N11GetKlass,             METH_NOARGS,                NULL},
    {"transformInclC14N11Id",                         (PyCFunction)xmlsec1_xmlSecTransformInclC14N11GetKlass,             METH_NOARGS,                NULL},
    {"transformInclC14N11WithCommentsGetKlass",       (PyCFunction)xmlsec1_xmlSecTransformInclC14N11WithCommentsGetKlass, METH_NOARGS,                NULL},
    {"transformInclC14N11WithCommentsId",             (PyCFunction)xmlsec1_xmlSecTransformInclC14N11WithCommentsGetKlass, METH_NOARGS,                NULL},
    {"transformExclC14NGetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformExclC14NGetKlass,               METH_NOARGS,                NULL},
    {"transformExclC14NId",                           (PyCFunction)xmlsec1_xmlSecTransformExclC14NGetKlass,               METH_NOARGS,                NULL},
    {"transformExclC14NWithCommentsGetKlass",         (PyCFunction)xmlsec1_xmlSecTransformExclC14NWithCommentsGetKlass,   METH_NOARGS,                NULL},
    {"transformExclC14NWithCommentsId",               (PyCFunction)xmlsec1_xmlSecTransformExclC14NWithCommentsGetKlass,   METH_NOARGS,                NULL},
    {"transformEnvelopedGetKlass",                    (PyCFunction)xmlsec1_xmlSecTransformEnvelopedGetKlass,              METH_NOARGS,                NULL},
    {"transformEnvelopedId",                          (PyCFunction)xmlsec1_xmlSecTransformEnvelopedGetKlass,              METH_NOARGS,                NULL},
    {"transformXPathGetKlass",                        (PyCFunction)xmlsec1_xmlSecTransformXPathGetKlass,                  METH_NOARGS,                NULL},
    {"transformXPathId",                              (PyCFunction)xmlsec1_xmlSecTransformXPathGetKlass,                  METH_NOARGS,                NULL},
    {"transformXPath2GetKlass",                       (PyCFunction)xmlsec1_xmlSecTransformXPath2GetKlass,                 METH_NOARGS,                NULL},
    {"transformXPath2Id",                             (PyCFunction)xmlsec1_xmlSecTransformXPath2GetKlass,                 METH_NOARGS,                NULL},
    {"transformXPointerGetKlass",                     (PyCFunction)xmlsec1_xmlSecTransformXPointerGetKlass,               METH_NOARGS,                NULL},
    {"transformXPointerId",                           (PyCFunction)xmlsec1_xmlSecTransformXPointerGetKlass,               METH_NOARGS,                NULL},
    {"transformXPointerSetExpr",                      (PyCFunction)xmlsec1_xmlSecTransformXPointerSetExpr,                METH_VARARGS|METH_KEYWORDS, NULL},
    {"transformXsltGetKlass",                         (PyCFunction)xmlsec1_xmlSecTransformXsltGetKlass,                   METH_NOARGS,                NULL},
    {"transformXsltId",                               (PyCFunction)xmlsec1_xmlSecTransformXsltGetKlass,                   METH_NOARGS,                NULL},
    {"transformRemoveXmlTagsC14NGetKlass",            (PyCFunction)xmlsec1_xmlSecTransformRemoveXmlTagsC14NGetKlass,      METH_NOARGS,                NULL},
    {"transformRemoveXmlTagsC14NId",                  (PyCFunction)xmlsec1_xmlSecTransformRemoveXmlTagsC14NGetKlass,      METH_NOARGS,                NULL},
    {"transformVisa3DHackGetKlass",                   (PyCFunction)xmlsec1_xmlSecTransformVisa3DHackGetKlass,             METH_NOARGS,                NULL},
    {"transformVisa3DHackId",                         (PyCFunction)xmlsec1_xmlSecTransformVisa3DHackGetKlass,             METH_NOARGS,                NULL},
    {"transformVisa3DHackSetID",                      (PyCFunction)xmlsec1_xmlSecTransformVisa3DHackSetID,                METH_VARARGS|METH_KEYWORDS, NULL},
    /* xmldsig */
    {"dSigCtxCreate",                                 (PyCFunction)xmlsec1_xmlSecDSigCtxCreate,                           METH_O,                     NULL},
    {"dSigCtxDestroy",                                (PyCFunction)xmlsec1_xmlSecDSigCtxDestroy,                          METH_O,                     NULL},
    {"dSigCtxVerify",                                 (PyCFunction)xmlsec1_xmlSecDSigCtxVerify,                           METH_VARARGS|METH_KEYWORDS, NULL},
    {"dSigCtxGetStatus",                              (PyCFunction)xmlsec1_xmlSecDSigCtxGetStatus,                        METH_O,                     NULL},
    {"dSigCtxGetEnabledReferenceUris",                (PyCFunction)xmlsec1_xmlSecDSigCtxGetEnabledReferenceUris,          METH_O,                     NULL},
    {"dSigCtxSetEnabledReferenceUris",                (PyCFunction)xmlsec1_xmlSecDSigCtxSetEnabledReferenceUris,          METH_VARARGS|METH_KEYWORDS, NULL},
    {"dSigCtxEnableSignatureTransform",               (PyCFunction)xmlsec1_xmlSecDSigCtxEnableSignatureTransform,         METH_VARARGS|METH_KEYWORDS, NULL},
    {"dSigCtxEnableReferenceTransform",               (PyCFunction)xmlsec1_xmlSecDSigCtxEnableReferenceTransform,         METH_VARARGS|METH_KEYWORDS, NULL},
    /* xmlenc */
    /* xmlsec */
    /* xmltree */
    {"findNode",                                      (PyCFunction)xmlsec1_xmlSecFindNode,                                METH_VARARGS|METH_KEYWORDS, NULL},
    /* x509 */
    {NULL, NULL}
};


/*
 * This callback is set by the module and converts xmlsec1 errors to Python exceptions.
 */
static void xmlsec1mod_xmlSecErrorsCallback(const char * file, int line, const char * func, const char * errorObject, const char * errorSubject, int reason, const char * msg)
{
    PyObject * module;

    if (XMLSEC_ERRORS_R_MALLOC_FAILED == reason || XMLSEC_ERRORS_R_STRDUP_FAILED == reason)
    {
        PyErr_NoMemory();
        return;
    }

    if (XMLSEC_ERRORS_R_NOT_IMPLEMENTED == reason)
    {
        PyErr_SetString(PyExc_NotImplementedError, errorSubject);
    }

    if (NULL == (module = PyImport_ImportModuleNoBlock("xmlsec1")))
    {
        return;
    }

    switch (reason)
    {
        case XMLSEC_ERRORS_R_XMLSEC_FAILED: /* An XMLSec function failed (error subject is the failed function). */
        {
            PyErr_SetString(GETSTATE(module)->xmlSecFailed, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_CRYPTO_FAILED: /* Crypto (OpenSSL) function failed (error subject is the failed function). */
        {
            PyErr_SetString(GETSTATE(module)->cryptoFailed, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_XML_FAILED: /* LibXML function failed (error subject is the failed function). */
        {
            PyErr_SetString(GETSTATE(module)->xmlFailed, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_XSLT_FAILED: /* LibXSLT function failed (error subject is the failed function). */
        {
            PyErr_SetString(GETSTATE(module)->xsltFailed, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_IO_FAILED: /* IO operation failed. */
        {
            PyErr_SetNone(GETSTATE(module)->ioFailed);
            break;
        }
        case XMLSEC_ERRORS_R_DISABLED: /* The feature is disabled during compilation. Check './configure --help' for details on how to enable it. */
        {
            PyErr_SetNone(GETSTATE(module)->disabled);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_SIZE: /* Invalid size. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidSize);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_DATA: /* Invalid data. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidData);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_RESULT: /* Invalid result. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidResult);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_TYPE: /* Invalid type. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidType);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_OPERATION: /* Invalid operation. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidOperation);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_STATUS: /* Invalid status. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidStatus);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_FORMAT: /* Invalid format. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidFormat);
            break;
        }
        case XMLSEC_ERRORS_R_DATA_NOT_MATCH: /* The data do not match our expectation. */
        {
            PyErr_SetNone(GETSTATE(module)->dataNotMatch);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_NODE: /* Invalid node (error subject is the node name). */
        {
            PyErr_SetString(GETSTATE(module)->invalidNode, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_NODE_CONTENT: /* Invalid node content (error subject is the node name). */
        {
            PyErr_SetString(GETSTATE(module)->invalidNodeContent, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE: /* Invalid node attribute (error subject is the node name). */
        {
            PyErr_SetString(GETSTATE(module)->invalidNodeAttribute, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_MISSING_NODE_ATTRIBUTE: /* Missing node attribute (error subject is the node name). */
        {
            PyErr_SetString(GETSTATE(module)->missingNodeAttribute, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_NODE_ALREADY_PRESENT: /* Node already present. */
        {
            PyErr_SetNone(GETSTATE(module)->nodeAlreadyPresent);
            break;
        }
        case XMLSEC_ERRORS_R_UNEXPECTED_NODE: /* Unexpected node (error subject is the node name). */
        {
            PyErr_SetString(GETSTATE(module)->unexpectedNode, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_NODE_NOT_FOUND: /* Node not found (error subject is the required node name). */
        {
            PyErr_SetString(GETSTATE(module)->nodeNotFound, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_TRANSFORM: /* This transform is invlaid here. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidTransform);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_TRANSFORM_KEY: /* Key is invalid for this transform. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidTransformKey);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_URI_TYPE: /* Invalid URI type. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidUriType);
            break;
        }
        case XMLSEC_ERRORS_R_TRANSFORM_SAME_DOCUMENT_REQUIRED: /* The transform requires the input document to be the same as context. */
        {
            PyErr_SetNone(GETSTATE(module)->transformSameDocumentRequired);
            break;
        }
        case XMLSEC_ERRORS_R_TRANSFORM_DISABLED: /* The transform is disabled. */
        {
            PyErr_SetNone(GETSTATE(module)->transformDisabled);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_KEY_DATA: /* Key data is invalid. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidKeyData);
            break;
        }
        case XMLSEC_ERRORS_R_KEY_DATA_NOT_FOUND: /* Data is not found (error subject is the data name). */
        {
            PyErr_SetString(GETSTATE(module)->keyDataNotFound, errorSubject);
            break;
        }
        case XMLSEC_ERRORS_R_KEY_DATA_ALREADY_EXIST: /* The key data is already exist. */
        {
            PyErr_SetNone(GETSTATE(module)->keyDataAlreadyExist);
            break;
        }
        case XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE: /* Invalid key size. */
        {
            PyErr_SetNone(GETSTATE(module)->invalidKeyDataSize);
            break;
        }
        case XMLSEC_ERRORS_R_KEY_NOT_FOUND: /* Key not found. */
        {
            PyErr_SetNone(GETSTATE(module)->keyNotFound);
            break;
        }
        case XMLSEC_ERRORS_R_KEYDATA_DISABLED: /* The key data type disabled. */
        {
            PyErr_SetNone(GETSTATE(module)->keyDataDisabled);
            break;
        }
        case XMLSEC_ERRORS_R_MAX_RETRIEVALS_LEVEL: /* Max allowed retrievals level reached. */
        {
            PyErr_SetNone(GETSTATE(module)->maxRetrievalsLevel);
            break;
        }
        case XMLSEC_ERRORS_R_MAX_RETRIEVAL_TYPE_MISMATCH: /* The retrieved key data type does not match the one specified in the <dsig:RetrievalMethod/> node. */
        {
            PyErr_SetNone(GETSTATE(module)->maxRetrievalTypeMismatch);
            break;
        }
        case XMLSEC_ERRORS_R_MAX_ENCKEY_LEVEL: /* Max EncryptedKey level reached. */
        {
            PyErr_SetNone(GETSTATE(module)->maxEncryptedKeyLevel);
            break;
        }
        case XMLSEC_ERRORS_R_CERT_VERIFY_FAILED: /* Certificate verification failed. */
        {
            PyErr_SetNone(GETSTATE(module)->certificateVerifyFailed);
            break;
        }
        case XMLSEC_ERRORS_R_CERT_NOT_FOUND: /* Requested certificate is not found. */
        {
            PyErr_SetNone(GETSTATE(module)->certificateNotFound);
            break;
        }
        case XMLSEC_ERRORS_R_CERT_REVOKED: /* The certificate is revoked. */
        {
            PyErr_SetNone(GETSTATE(module)->certificateRevoked);
            break;
        }
        case XMLSEC_ERRORS_R_CERT_ISSUER_FAILED: /* Failed to get certificate issuer. */
        {
            PyErr_SetNone(GETSTATE(module)->certificateIssuerFailed);
            break;
        }
        case XMLSEC_ERRORS_R_CERT_NOT_YET_VALID: /* "Not valid before" verification failed. */
        {
            PyErr_SetNone(GETSTATE(module)->certificateNotYetValid);
            break;
        }
        case XMLSEC_ERRORS_R_CERT_HAS_EXPIRED: /* "Not valid after" verification failed. */
        {
            PyErr_SetNone(GETSTATE(module)->certificateHasExpired);
            break;
        }
        case XMLSEC_ERRORS_R_DSIG_NO_REFERENCES: /* The <dsig:Reference> nodes not found. */
        {
            PyErr_SetNone(GETSTATE(module)->dsigNoReferences);
            break;
        }
        case XMLSEC_ERRORS_R_DSIG_INVALID_REFERENCE: /* The <dsig:Reference> validation failed. */
        {
            PyErr_SetNone(GETSTATE(module)->dsigInvalidReference);
            break;
        }
        case XMLSEC_ERRORS_R_ASSERTION: /* Invalid assertion. */
        {
            PyErr_SetNone(GETSTATE(module)->assertion);
            break;
        }
        default:
        {
            PyErr_SetObject(GETSTATE(module)->error, Py_BuildValue("(sisssis)", file, line, func, errorObject, errorSubject, reason, msg));
            break;
        }
    }

    Py_CLEAR(module);
}


PyDoc_STRVAR(module_doc, "Module wraps the xmlsec1 library.");


static void xmlsec1mod_clear_module_state_vars(struct module_state * ms)
{
    Py_CLEAR(ms->xmlSecFailed);
    Py_CLEAR(ms->cryptoFailed);
    Py_CLEAR(ms->xmlFailed);
    Py_CLEAR(ms->xsltFailed);
    Py_CLEAR(ms->ioFailed);
    Py_CLEAR(ms->disabled);
    Py_CLEAR(ms->invalidSize);
    Py_CLEAR(ms->invalidData);
    Py_CLEAR(ms->invalidResult);
    Py_CLEAR(ms->invalidType);
    Py_CLEAR(ms->invalidOperation);
    Py_CLEAR(ms->invalidStatus);
    Py_CLEAR(ms->invalidFormat);
    Py_CLEAR(ms->dataNotMatch);
    Py_CLEAR(ms->invalidNode);
    Py_CLEAR(ms->invalidNodeContent);
    Py_CLEAR(ms->invalidNodeAttribute);
    Py_CLEAR(ms->missingNodeAttribute);
    Py_CLEAR(ms->nodeAlreadyPresent);
    Py_CLEAR(ms->unexpectedNode);
    Py_CLEAR(ms->nodeNotFound);
    Py_CLEAR(ms->invalidTransform);
    Py_CLEAR(ms->invalidTransformKey);
    Py_CLEAR(ms->invalidUriType);
    Py_CLEAR(ms->transformSameDocumentRequired);
    Py_CLEAR(ms->transformDisabled);
    Py_CLEAR(ms->invalidKeyData);
    Py_CLEAR(ms->keyDataNotFound);
    Py_CLEAR(ms->keyDataAlreadyExist);
    Py_CLEAR(ms->invalidKeyDataSize);
    Py_CLEAR(ms->keyNotFound);
    Py_CLEAR(ms->keyDataDisabled);
    Py_CLEAR(ms->maxRetrievalsLevel);
    Py_CLEAR(ms->maxRetrievalTypeMismatch);
    Py_CLEAR(ms->maxEncryptedKeyLevel);
    Py_CLEAR(ms->certificateVerifyFailed);
    Py_CLEAR(ms->certificateNotFound);
    Py_CLEAR(ms->certificateRevoked);
    Py_CLEAR(ms->certificateIssuerFailed);
    Py_CLEAR(ms->certificateNotYetValid);
    Py_CLEAR(ms->certificateHasExpired);
    Py_CLEAR(ms->dsigNoReferences);
    Py_CLEAR(ms->dsigInvalidReference);
    Py_CLEAR(ms->assertion);
    Py_CLEAR(ms->error);
}


#if PY_MAJOR_VERSION >= 3
static int xmlsec1_traverse(PyObject * m, visitproc visit, void * arg)
{
    Py_VISIT(GETSTATE(m)->error);
    return 0;
}

static int xmlsec1_clear(PyObject * m)
{
    xmlsec1mod_clear_module_state_vars(GETSTATE(m));
    return 0;
}

static struct PyModuleDef xmlsec1_moduledef = {
    PyModuleDef_HEAD_INIT,
    "xmlsec1",
    module_doc,
    sizeof(struct module_state),
    xmlsec1_methods,
    NULL,
    xmlsec1_traverse,
    xmlsec1_clear,
    NULL
};

#define INITERROR return NULL

#else /* ! PY_MAJOR_VERSION >= 3 */
#define INITERROR return
#endif


PyMODINIT_FUNC
#if PY_MAJOR_VERSION >= 3
PyInit_xmlsec1(void)
#else
initxmlsec1(void)
#endif
{
    struct module_state * st;

#if 0
    if (PyType_Ready(&xmlsec1_xmlSecBase64CtxType) < 0)
    {
        INITERROR;
    }
#endif

#if PY_MAJOR_VERSION >= 3
    PyObject * module = PyModule_Create(&xmlsec1_moduledef);
#else
    PyObject * module = Py_InitModule3("xmlsec1", xmlsec1_methods, module_doc);
#endif

    if (NULL == module)
    {
        INITERROR;
    }

#if 0
    Py_INCREF(&xmlsec1_xmlSecBase64CtxType);
    PyModule_AddObject(module, "Base64", (PyObject *)&xmlsec1_xmlSecBase64CtxType);
#endif

    PyModule_AddStringConstant(module, "XMLSEC_VERSION", XMLSEC_VERSION);
    PyModule_AddIntConstant(module, "XMLSEC_VERSION_MAJOR", XMLSEC_VERSION_MAJOR);
    PyModule_AddIntConstant(module, "XMLSEC_VERSION_MINOR", XMLSEC_VERSION_MINOR);
    PyModule_AddIntConstant(module, "XMLSEC_VERSION_SUBMINOR", XMLSEC_VERSION_SUBMINOR);
    PyModule_AddStringConstant(module, "XMLSEC_VERSION_INFO", XMLSEC_VERSION_INFO);
    PyModule_AddIntConstant(module, "xmlSecCheckVersionExactMatch", xmlSecCheckVersionExactMatch);
    PyModule_AddIntConstant(module, "xmlSecCheckVersionABICompatible", xmlSecCheckVersionABICompatible);

    /* ** bn ** */
    /* xmlSecBnFormat */
    PyModule_AddIntConstant(module, "xmlSecBnBase64", xmlSecBnBase64);
    PyModule_AddIntConstant(module, "xmlSecBnHex", xmlSecBnHex);
    PyModule_AddIntConstant(module, "xmlSecBnDec", xmlSecBnDec);
    /* ** base64 ** */
    PyModule_AddIntMacro(module, XMLSEC_BASE64_LINESIZE);
    /* ** buffer ** */
    PyModule_AddIntConstant(module, "xmlSecAllocModeExact", xmlSecAllocModeExact);
    PyModule_AddIntConstant(module, "xmlSecAllocModeDouble", xmlSecAllocModeDouble);
    /* ** transform ** */
    /* general */
    PyModule_AddIntMacro(module, XMLSEC_TRANSFORM_BINARY_CHUNK);
    PyModule_AddIntMacro(module, XMLSEC_TRANSFORMCTX_FLAGS_USE_VISA3D_HACK);
    /* xmlSecTransformUriType */
    PyModule_AddIntMacro(module, xmlSecTransformUriTypeNone);
    PyModule_AddIntMacro(module, xmlSecTransformUriTypeEmpty);
    PyModule_AddIntMacro(module, xmlSecTransformUriTypeSameDocument);
    PyModule_AddIntMacro(module, xmlSecTransformUriTypeLocal);
    PyModule_AddIntMacro(module, xmlSecTransformUriTypeRemote);
    PyModule_AddIntMacro(module, xmlSecTransformUriTypeAny);
    /* xmlSecTransformDataType */
    PyModule_AddIntMacro(module, xmlSecTransformDataTypeUnknown);
    PyModule_AddIntMacro(module, xmlSecTransformDataTypeBin);
    PyModule_AddIntMacro(module, xmlSecTransformDataTypeXml);
    /* xmlSecTransformUsage */
    PyModule_AddIntMacro(module, xmlSecTransformUsageUnknown);
    PyModule_AddIntMacro(module, xmlSecTransformUsageDSigTransform);
    PyModule_AddIntMacro(module, xmlSecTransformUsageC14NMethod);
    PyModule_AddIntMacro(module, xmlSecTransformUsageDigestMethod);
    PyModule_AddIntMacro(module, xmlSecTransformUsageSignatureMethod);
    PyModule_AddIntMacro(module, xmlSecTransformUsageEncryptionMethod);
    PyModule_AddIntMacro(module, xmlSecTransformUsageAny);
    /* xmlSecTransformStatus */
    PyModule_AddIntConstant(module, "xmlSecTransformStatusNone", xmlSecTransformStatusNone);
    PyModule_AddIntConstant(module, "xmlSecTransformStatusWorking", xmlSecTransformStatusWorking);
    PyModule_AddIntConstant(module, "xmlSecTransformStatusFinished", xmlSecTransformStatusFinished);
    PyModule_AddIntConstant(module, "xmlSecTransformStatusOk", xmlSecTransformStatusOk);
    PyModule_AddIntConstant(module, "xmlSecTransformStatusFail", xmlSecTransformStatusFail);
    /* xmlSecTransformMode */
    PyModule_AddIntConstant(module, "xmlSecTransformModeNone", xmlSecTransformModeNone);
    PyModule_AddIntConstant(module, "xmlSecTransformModePush", xmlSecTransformModePush);
    PyModule_AddIntConstant(module, "xmlSecTransformModePop", xmlSecTransformModePop);
    /* xmlSecTransformOperation */
    PyModule_AddIntConstant(module, "xmlSecTransformOperationNone", xmlSecTransformOperationNone);
    PyModule_AddIntConstant(module, "xmlSecTransformOperationEncode", xmlSecTransformOperationEncode);
    PyModule_AddIntConstant(module, "xmlSecTransformOperationDecode", xmlSecTransformOperationDecode);
    PyModule_AddIntConstant(module, "xmlSecTransformOperationSign", xmlSecTransformOperationSign);
    PyModule_AddIntConstant(module, "xmlSecTransformOperationVerify", xmlSecTransformOperationVerify);
    PyModule_AddIntConstant(module, "xmlSecTransformOperationEncrypt", xmlSecTransformOperationEncrypt);
    PyModule_AddIntConstant(module, "xmlSecTransformOperationDecrypt", xmlSecTransformOperationDecrypt);
    /* ** keyinfo ** */
    /* general */
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_DONT_STOP_ON_KEY_FOUND);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_STOP_ON_UNKNOWN_CHILD);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_KEYNAME_STOP_ON_UNKNOWN);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_KEYVALUE_STOP_ON_UNKNOWN_CHILD);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_RETRMETHOD_STOP_ON_UNKNOWN_HREF);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_RETRMETHOD_STOP_ON_MISMATCH_HREF);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_X509DATA_STOP_ON_UNKNOWN_CHILD);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_X509DATA_STOP_ON_UNKNOWN_CERT);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_X509DATA_STOP_ON_INVALID_CERT);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_ENCKEY_DONT_STOP_ON_FAILED_DECRYPTION);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE);
    PyModule_AddIntMacro(module, XMLSEC_KEYINFO_FLAGS_X509DATA_SKIP_STRICT_CHECKS);
    /* xmlSecKeyInfoMode */
    PyModule_AddIntConstant(module, "xmlSecKeyInfoModeRead", xmlSecKeyInfoModeRead);
    PyModule_AddIntConstant(module, "xmlSecKeyInfoModeWrite", xmlSecKeyInfoModeWrite);
    /* ** keysdata ** */
    /* xmlSecKeyDataUsage */
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageUnknown);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageKeyInfoNodeRead);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageKeyInfoNodeWrite);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageKeyValueNodeRead);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageKeyValueNodeWrite);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageRetrievalMethodNodeXml);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageRetrievalMethodNodeBin);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageAny);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageKeyInfoNode);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageKeyValueNode);
    PyModule_AddIntMacro(module, xmlSecKeyDataUsageRetrievalMethodNode);
    /* xmlSecKeyDataType */
    PyModule_AddIntMacro(module, xmlSecKeyDataTypeUnknown);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypeNone);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypePublic);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypePrivate);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypeSymmetric);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypeSession);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypePermanent);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypeTrusted);
    PyModule_AddIntMacro(module, xmlSecKeyDataTypeAny);
    /* xmlSecKeyDataFormat */
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatUnknown", xmlSecKeyDataFormatUnknown);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatBinary", xmlSecKeyDataFormatBinary);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatPem", xmlSecKeyDataFormatPem);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatDer", xmlSecKeyDataFormatDer);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatPkcs8Pem", xmlSecKeyDataFormatPkcs8Pem);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatPkcs8Der", xmlSecKeyDataFormatPkcs8Der);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatPkcs12", xmlSecKeyDataFormatPkcs12);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatCertPem", xmlSecKeyDataFormatCertPem);
    PyModule_AddIntConstant(module, "xmlSecKeyDataFormatCertDer", xmlSecKeyDataFormatCertDer);
    /* keysdata binary bits */
    PyModule_AddIntMacro(module, xmlSecKeyDataBinarySize);
    /* ** keys ** */
    PyModule_AddIntMacro(module, xmlSecKeyUsageSign);
    PyModule_AddIntMacro(module, xmlSecKeyUsageVerify);
    PyModule_AddIntMacro(module, xmlSecKeyUsageEncrypt);
    PyModule_AddIntMacro(module, xmlSecKeyUsageDecrypt);
    PyModule_AddIntMacro(module, xmlSecKeyUsageKeyExchange);
    PyModule_AddIntMacro(module, xmlSecKeyUsageAny);
    /* ** strings ** */
    /* global namespace */
    PyModule_AddStringConstant(module, "xmlSecNs", (const char *)xmlSecNs);
    PyModule_AddStringConstant(module, "xmlSecDSigNs", (const char *)xmlSecDSigNs);
    PyModule_AddStringConstant(module, "xmlSecEncNs", (const char *)xmlSecEncNs);
    PyModule_AddStringConstant(module, "xmlSecXkmsNs", (const char *)xmlSecXkmsNs);
    PyModule_AddStringConstant(module, "xmlSecXPathNs", (const char *)xmlSecXPathNs);
    PyModule_AddStringConstant(module, "xmlSecXPath2Ns", (const char *)xmlSecXPath2Ns);
    PyModule_AddStringConstant(module, "xmlSecXPointerNs", (const char *)xmlSecXPointerNs);
    PyModule_AddStringConstant(module, "xmlSecSoap11Ns", (const char *)xmlSecSoap11Ns);
    PyModule_AddStringConstant(module, "xmlSecSoap12Ns", (const char *)xmlSecSoap12Ns);
    /* dsig nodes */
    PyModule_AddStringConstant(module, "xmlSecNodeSignature", (const char *)xmlSecNodeSignature);
    PyModule_AddStringConstant(module, "xmlSecNodeSignedInfo", (const char *)xmlSecNodeSignedInfo);
    PyModule_AddStringConstant(module, "xmlSecNodeSignatureValue", (const char *)xmlSecNodeSignatureValue);
    PyModule_AddStringConstant(module, "xmlSecNodeCanonicalizationMethod", (const char *)xmlSecNodeCanonicalizationMethod);
    PyModule_AddStringConstant(module, "xmlSecNodeSignatureMethod", (const char *)xmlSecNodeSignatureMethod);
    PyModule_AddStringConstant(module, "xmlSecNodeDigestMethod", (const char *)xmlSecNodeDigestMethod);
    PyModule_AddStringConstant(module, "xmlSecNodeDigestValue", (const char *)xmlSecNodeDigestValue);
    PyModule_AddStringConstant(module, "xmlSecNodeObject", (const char *)xmlSecNodeObject);
    PyModule_AddStringConstant(module, "xmlSecNodeManifest", (const char *)xmlSecNodeManifest);
    PyModule_AddStringConstant(module, "xmlSecNodeSignatureProperties", (const char *)xmlSecNodeSignatureProperties);
    /* encryption nodes */
    PyModule_AddStringConstant(module, "xmlSecNodeEncryptedData", (const char *)xmlSecNodeEncryptedData);
    PyModule_AddStringConstant(module, "xmlSecNodeEncryptionMethod", (const char *)xmlSecNodeEncryptionMethod);
    PyModule_AddStringConstant(module, "xmlSecNodeEncryptionProperties", (const char *)xmlSecNodeEncryptionProperties);
    PyModule_AddStringConstant(module, "xmlSecNodeEncryptionProperty", (const char *)xmlSecNodeEncryptionProperty);
    PyModule_AddStringConstant(module, "xmlSecNodeCipherData", (const char *)xmlSecNodeCipherData);
    PyModule_AddStringConstant(module, "xmlSecNodeCipherValue", (const char *)xmlSecNodeCipherValue);
    PyModule_AddStringConstant(module, "xmlSecNodeCipherReference", (const char *)xmlSecNodeCipherReference);
    PyModule_AddStringConstant(module, "xmlSecNodeReferenceList", (const char *)xmlSecNodeReferenceList);
    PyModule_AddStringConstant(module, "xmlSecNodeDataReference", (const char *)xmlSecNodeDataReference);
    PyModule_AddStringConstant(module, "xmlSecNodeKeyReference", (const char *)xmlSecNodeKeyReference);
    PyModule_AddStringConstant(module, "xmlSecNodeCarriedKeyName", (const char *)xmlSecNodeCarriedKeyName);

    PyModule_AddStringConstant(module, "xmlSecTypeEncContent", (const char *)xmlSecTypeEncContent);
    PyModule_AddStringConstant(module, "xmlSecTypeEncElement", (const char *)xmlSecTypeEncElement);
    /* XKMS nodes, attributes  and value strings */
#ifndef XMLSEC_NO_XKMS
    PyModule_AddStringConstant(module, "xmlSecXkmsServerRequestResultName", (const char *)xmlSecXkmsServerRequestResultName);
    PyModule_AddStringConstant(module, "xmlSecXkmsServerRequestStatusName", (const char *)xmlSecXkmsServerRequestStatusName);
    PyModule_AddStringConstant(module, "xmlSecXkmsServerRequestLocateName", (const char *)xmlSecXkmsServerRequestLocateName);
    PyModule_AddStringConstant(module, "xmlSecXkmsServerRequestValidateName", (const char *)xmlSecXkmsServerRequestValidateName);
    PyModule_AddStringConstant(module, "xmlSecXkmsServerRequestCompoundName", (const char *)xmlSecXkmsServerRequestCompoundName);

    PyModule_AddStringConstant(module, "xmlSecNodeResult", (const char *)xmlSecNodeResult);
    PyModule_AddStringConstant(module, "xmlSecNodeStatusRequest", (const char *)xmlSecNodeStatusRequest);
    PyModule_AddStringConstant(module, "xmlSecNodeStatusResult", (const char *)xmlSecNodeStatusResult);
    PyModule_AddStringConstant(module, "xmlSecNodeLocateRequest", (const char *)xmlSecNodeLocateRequest);
    PyModule_AddStringConstant(module, "xmlSecNodeLocateResult", (const char *)xmlSecNodeLocateResult);
    PyModule_AddStringConstant(module, "xmlSecNodeValidateRequest", (const char *)xmlSecNodeValidateRequest);
    PyModule_AddStringConstant(module, "xmlSecNodeValidateResult", (const char *)xmlSecNodeValidateResult);
    PyModule_AddStringConstant(module, "xmlSecNodeCompoundRequest", (const char *)xmlSecNodeCompoundRequest);
    PyModule_AddStringConstant(module, "xmlSecNodeCompoundResult", (const char *)xmlSecNodeCompoundResult);

    PyModule_AddStringConstant(module, "xmlSecNodeMessageExtension", (const char *)xmlSecNodeMessageExtension);
    PyModule_AddStringConstant(module, "xmlSecNodeOpaqueClientData", (const char *)xmlSecNodeOpaqueClientData);
    PyModule_AddStringConstant(module, "xmlSecNodeResponseMechanism", (const char *)xmlSecNodeResponseMechanism);
    PyModule_AddStringConstant(module, "xmlSecNodeRespondWith", (const char *)xmlSecNodeRespondWith);
    PyModule_AddStringConstant(module, "xmlSecNodePendingNotification", (const char *)xmlSecNodePendingNotification);
    PyModule_AddStringConstant(module, "xmlSecNodeQueryKeyBinding", (const char *)xmlSecNodeQueryKeyBinding);
    PyModule_AddStringConstant(module, "xmlSecNodeKeyUsage", (const char *)xmlSecNodeKeyUsage);
    PyModule_AddStringConstant(module, "xmlSecNodeUseKeyWith", (const char *)xmlSecNodeUseKeyWith);
    PyModule_AddStringConstant(module, "xmlSecNodeTimeInstant", (const char *)xmlSecNodeTimeInstant);
    PyModule_AddStringConstant(module, "xmlSecNodeRequestSignatureValue", (const char *)xmlSecNodeRequestSignatureValue);
    PyModule_AddStringConstant(module, "xmlSecNodeUnverifiedKeyBinding", (const char *)xmlSecNodeUnverifiedKeyBinding);
    PyModule_AddStringConstant(module, "xmlSecNodeValidityInterval", (const char *)xmlSecNodeValidityInterval);
    PyModule_AddStringConstant(module, "xmlSecNodeStatus", (const char *)xmlSecNodeStatus);
    PyModule_AddStringConstant(module, "xmlSecNodeValidReason", (const char *)xmlSecNodeValidReason);
    PyModule_AddStringConstant(module, "xmlSecNodeInvalidReason", (const char *)xmlSecNodeInvalidReason);
    PyModule_AddStringConstant(module, "xmlSecNodeIndeterminateReason", (const char *)xmlSecNodeIndeterminateReason);

    PyModule_AddStringConstant(module, "xmlSecAttrService", (const char *)xmlSecAttrService);
    PyModule_AddStringConstant(module, "xmlSecAttrNonce", (const char *)xmlSecAttrNonce);
    PyModule_AddStringConstant(module, "xmlSecAttrOriginalRequestId", (const char *)xmlSecAttrOriginalRequestId);
    PyModule_AddStringConstant(module, "xmlSecAttrResponseLimit", (const char *)xmlSecAttrResponseLimit);
    PyModule_AddStringConstant(module, "xmlSecAttrMechanism", (const char *)xmlSecAttrMechanism);
    PyModule_AddStringConstant(module, "xmlSecAttrIdentifier", (const char *)xmlSecAttrIdentifier);
    PyModule_AddStringConstant(module, "xmlSecAttrApplication", (const char *)xmlSecAttrApplication);
    PyModule_AddStringConstant(module, "xmlSecAttrResultMajor", (const char *)xmlSecAttrResultMajor);
    PyModule_AddStringConstant(module, "xmlSecAttrResultMinor", (const char *)xmlSecAttrResultMinor);
    PyModule_AddStringConstant(module, "xmlSecAttrRequestId", (const char *)xmlSecAttrRequestId);
    PyModule_AddStringConstant(module, "xmlSecAttrNotBefore", (const char *)xmlSecAttrNotBefore);
    PyModule_AddStringConstant(module, "xmlSecAttrNotOnOrAfter", (const char *)xmlSecAttrNotOnOrAfter);
    PyModule_AddStringConstant(module, "xmlSecAttrTime", (const char *)xmlSecAttrTime);
    PyModule_AddStringConstant(module, "xmlSecAttrStatusValue", (const char *)xmlSecAttrStatusValue);

    PyModule_AddStringConstant(module, "xmlSecResponseMechanismPending", (const char *)xmlSecResponseMechanismPending);
    PyModule_AddStringConstant(module, "xmlSecResponseMechanismRepresent", (const char *)xmlSecResponseMechanismRepresent);
    PyModule_AddStringConstant(module, "xmlSecResponseMechanismRequestSignatureValue", (const char *)xmlSecResponseMechanismRequestSignatureValue);

    PyModule_AddStringConstant(module, "xmlSecRespondWithKeyName", (const char *)xmlSecRespondWithKeyName);
    PyModule_AddStringConstant(module, "xmlSecRespondWithKeyValue", (const char *)xmlSecRespondWithKeyValue);
    PyModule_AddStringConstant(module, "xmlSecRespondWithX509Cert", (const char *)xmlSecRespondWithX509Cert);
    PyModule_AddStringConstant(module, "xmlSecRespondWithX509Chain", (const char *)xmlSecRespondWithX509Chain);
    PyModule_AddStringConstant(module, "xmlSecRespondWithX509CRL", (const char *)xmlSecRespondWithX509CRL);
    PyModule_AddStringConstant(module, "xmlSecRespondWithOCSP", (const char *)xmlSecRespondWithOCSP);
    PyModule_AddStringConstant(module, "xmlSecRespondWithRetrievalMethod", (const char *)xmlSecRespondWithRetrievalMethod);
    PyModule_AddStringConstant(module, "xmlSecRespondWithPGP", (const char *)xmlSecRespondWithPGP);
    PyModule_AddStringConstant(module, "xmlSecRespondWithPGPWeb", (const char *)xmlSecRespondWithPGPWeb);
    PyModule_AddStringConstant(module, "xmlSecRespondWithSPKI", (const char *)xmlSecRespondWithSPKI);
    PyModule_AddStringConstant(module, "xmlSecRespondWithPrivateKey", (const char *)xmlSecRespondWithPrivateKey);

    PyModule_AddStringConstant(module, "xmlSecStatusResultSuccess", (const char *)xmlSecStatusResultSuccess);
    PyModule_AddStringConstant(module, "xmlSecStatusResultFailed", (const char *)xmlSecStatusResultFailed);
    PyModule_AddStringConstant(module, "xmlSecStatusResultPending", (const char *)xmlSecStatusResultPending);

    PyModule_AddStringConstant(module, "xmlSecKeyUsageEncryption", (const char *)xmlSecKeyUsageEncryption);
    PyModule_AddStringConstant(module, "xmlSecKeyUsageSignature", (const char *)xmlSecKeyUsageSignature);
    PyModule_AddStringConstant(module, "xmlSecKeyUsageExchange", (const char *)xmlSecKeyUsageExchange);

    PyModule_AddStringConstant(module, "xmlSecKeyBindingStatusValid", (const char *)xmlSecKeyBindingStatusValid);
    PyModule_AddStringConstant(module, "xmlSecKeyBindingStatusInvalid", (const char *)xmlSecKeyBindingStatusInvalid);
    PyModule_AddStringConstant(module, "xmlSecKeyBindingStatusIndeterminate", (const char *)xmlSecKeyBindingStatusIndeterminate);

    PyModule_AddStringConstant(module, "xmlSecKeyBindingReasonIssuerTrust", (const char *)xmlSecKeyBindingReasonIssuerTrust);
    PyModule_AddStringConstant(module, "xmlSecKeyBindingReasonRevocationStatus", (const char *)xmlSecKeyBindingReasonRevocationStatus);
    PyModule_AddStringConstant(module, "xmlSecKeyBindingReasonValidityInterval", (const char *)xmlSecKeyBindingReasonValidityInterval);
    PyModule_AddStringConstant(module, "xmlSecKeyBindingReasonSignature", (const char *)xmlSecKeyBindingReasonSignature);

    PyModule_AddStringConstant(module, "xmlSecResultMajorCodeSuccess", (const char *)xmlSecResultMajorCodeSuccess);
    PyModule_AddStringConstant(module, "xmlSecResultMajorCodeVersionMismatch", (const char *)xmlSecResultMajorCodeVersionMismatch);
    PyModule_AddStringConstant(module, "xmlSecResultMajorCodeSender", (const char *)xmlSecResultMajorCodeSender);
    PyModule_AddStringConstant(module, "xmlSecResultMajorCodeReceiver", (const char *)xmlSecResultMajorCodeReceiver);
    PyModule_AddStringConstant(module, "xmlSecResultMajorCodeRepresent", (const char *)xmlSecResultMajorCodeRepresent);
    PyModule_AddStringConstant(module, "xmlSecResultMajorCodePending", (const char *)xmlSecResultMajorCodePending);

    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeNoMatch", (const char *)xmlSecResultMinorCodeNoMatch);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeTooManyResponses", (const char *)xmlSecResultMinorCodeTooManyResponses);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeIncomplete", (const char *)xmlSecResultMinorCodeIncomplete);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeFailure", (const char *)xmlSecResultMinorCodeFailure);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeRefused", (const char *)xmlSecResultMinorCodeRefused);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeNoAuthentication", (const char *)xmlSecResultMinorCodeNoAuthentication);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeMessageNotSupported", (const char *)xmlSecResultMinorCodeMessageNotSupported);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeUnknownResponseId", (const char *)xmlSecResultMinorCodeUnknownResponseId);
    PyModule_AddStringConstant(module, "xmlSecResultMinorCodeNotSynchronous", (const char *)xmlSecResultMinorCodeNotSynchronous);

    PyModule_AddStringConstant(module, "xmlSecXkmsSoapFaultReasonLang", (const char *)xmlSecXkmsSoapFaultReasonLang);
    PyModule_AddStringConstant(module, "xmlSecXkmsSoapFaultReasonUnsupportedVersion", (const char *)xmlSecXkmsSoapFaultReasonUnsupportedVersion);
    PyModule_AddStringConstant(module, "xmlSecXkmsSoapFaultReasonUnableToProcess", (const char *)xmlSecXkmsSoapFaultReasonUnableToProcess);
    PyModule_AddStringConstant(module, "xmlSecXkmsSoapFaultReasonServiceUnavailable", (const char *)xmlSecXkmsSoapFaultReasonServiceUnavailable);
    PyModule_AddStringConstant(module, "xmlSecXkmsSoapFaultReasonMessageNotSupported", (const char *)xmlSecXkmsSoapFaultReasonMessageNotSupported);
    PyModule_AddStringConstant(module, "xmlSecXkmsSoapFaultReasonMessageInvalid", (const char *)xmlSecXkmsSoapFaultReasonMessageInvalid);

    PyModule_AddStringConstant(module, "xmlSecXkmsSoapSubcodeValueMessageNotSupported", (const char *)xmlSecXkmsSoapSubcodeValueMessageNotSupported);
    PyModule_AddStringConstant(module, "xmlSecXkmsSoapSubcodeValueBadMessage", (const char *)xmlSecXkmsSoapSubcodeValueBadMessage);

    PyModule_AddStringConstant(module, "xmlSecXkmsFormatStrPlain", (const char *)xmlSecXkmsFormatStrPlain);
    PyModule_AddStringConstant(module, "xmlSecXkmsFormatStrSoap11", (const char *)xmlSecXkmsFormatStrSoap11);
    PyModule_AddStringConstant(module, "xmlSecXkmsFormatStrSoap12", (const char *)xmlSecXkmsFormatStrSoap12);
#endif
    /* KeyInfo and Transform Nodes */
    PyModule_AddStringConstant(module, "xmlSecNodeKeyInfo", (const char *)xmlSecNodeKeyInfo);
    PyModule_AddStringConstant(module, "xmlSecNodeReference", (const char *)xmlSecNodeReference);
    PyModule_AddStringConstant(module, "xmlSecNodeTransforms", (const char *)xmlSecNodeTransforms);
    PyModule_AddStringConstant(module, "xmlSecNodeTransform", (const char *)xmlSecNodeTransform);
    /* Attributes */
    PyModule_AddStringConstant(module, "xmlSecAttrId", (const char *)xmlSecAttrId);
    PyModule_AddStringConstant(module, "xmlSecAttrURI", (const char *)xmlSecAttrURI);
    PyModule_AddStringConstant(module, "xmlSecAttrType", (const char *)xmlSecAttrType);
    PyModule_AddStringConstant(module, "xmlSecAttrMimeType", (const char *)xmlSecAttrMimeType);
    PyModule_AddStringConstant(module, "xmlSecAttrEncoding", (const char *)xmlSecAttrEncoding);
    PyModule_AddStringConstant(module, "xmlSecAttrAlgorithm", (const char *)xmlSecAttrAlgorithm);
    PyModule_AddStringConstant(module, "xmlSecAttrTarget", (const char *)xmlSecAttrTarget);
    PyModule_AddStringConstant(module, "xmlSecAttrFilter", (const char *)xmlSecAttrFilter);
    PyModule_AddStringConstant(module, "xmlSecAttrRecipient", (const char *)xmlSecAttrRecipient);
    /* AES strings */
    PyModule_AddStringConstant(module, "xmlSecNameAESKeyValue", (const char *)xmlSecNameAESKeyValue);
    PyModule_AddStringConstant(module, "xmlSecNodeAESKeyValue", (const char *)xmlSecNodeAESKeyValue);
    PyModule_AddStringConstant(module, "xmlSecHrefAESKeyValue", (const char *)xmlSecHrefAESKeyValue);

    PyModule_AddStringConstant(module, "xmlSecNameAes128Cbc", (const char *)xmlSecNameAes128Cbc);
    PyModule_AddStringConstant(module, "xmlSecHrefAes128Cbc", (const char *)xmlSecHrefAes128Cbc);

    PyModule_AddStringConstant(module, "xmlSecNameAes192Cbc", (const char *)xmlSecNameAes192Cbc);
    PyModule_AddStringConstant(module, "xmlSecHrefAes192Cbc", (const char *)xmlSecHrefAes192Cbc);

    PyModule_AddStringConstant(module, "xmlSecNameAes256Cbc", (const char *)xmlSecNameAes256Cbc);
    PyModule_AddStringConstant(module, "xmlSecHrefAes256Cbc", (const char *)xmlSecHrefAes256Cbc);

    PyModule_AddStringConstant(module, "xmlSecNameKWAes128", (const char *)xmlSecNameKWAes128);
    PyModule_AddStringConstant(module, "xmlSecHrefKWAes128", (const char *)xmlSecHrefKWAes128);

    PyModule_AddStringConstant(module, "xmlSecNameKWAes192", (const char *)xmlSecNameKWAes192);
    PyModule_AddStringConstant(module, "xmlSecHrefKWAes192", (const char *)xmlSecHrefKWAes192);

    PyModule_AddStringConstant(module, "xmlSecNameKWAes256", (const char *)xmlSecNameKWAes256);
    PyModule_AddStringConstant(module, "xmlSecHrefKWAes256", (const char *)xmlSecHrefKWAes256);
    /* BASE64 strings */
    PyModule_AddStringConstant(module, "xmlSecNameBase64", (const char *)xmlSecNameBase64);
    PyModule_AddStringConstant(module, "xmlSecHrefBase64", (const char *)xmlSecHrefBase64);
    /* C14N strings */
    PyModule_AddStringConstant(module, "xmlSecNameC14N", (const char *)xmlSecNameC14N);
    PyModule_AddStringConstant(module, "xmlSecHrefC14N", (const char *)xmlSecHrefC14N);

    PyModule_AddStringConstant(module, "xmlSecNameC14NWithComments", (const char *)xmlSecNameC14NWithComments);
    PyModule_AddStringConstant(module, "xmlSecHrefC14NWithComments", (const char *)xmlSecHrefC14NWithComments);

    PyModule_AddStringConstant(module, "xmlSecNameC14N11", (const char *)xmlSecNameC14N11);
    PyModule_AddStringConstant(module, "xmlSecHrefC14N11", (const char *)xmlSecHrefC14N11);

    PyModule_AddStringConstant(module, "xmlSecNameC14N11WithComments", (const char *)xmlSecNameC14N11WithComments);
    PyModule_AddStringConstant(module, "xmlSecHrefC14N11WithComments", (const char *)xmlSecHrefC14N11WithComments);

    PyModule_AddStringConstant(module, "xmlSecNameExcC14N", (const char *)xmlSecNameExcC14N);
    PyModule_AddStringConstant(module, "xmlSecHrefExcC14N", (const char *)xmlSecHrefExcC14N);

    PyModule_AddStringConstant(module, "xmlSecNameExcC14NWithComments", (const char *)xmlSecNameExcC14NWithComments);
    PyModule_AddStringConstant(module, "xmlSecHrefExcC14NWithComments", (const char *)xmlSecHrefExcC14NWithComments);

    PyModule_AddStringConstant(module, "xmlSecNsExcC14N", (const char *)xmlSecNsExcC14N);
    PyModule_AddStringConstant(module, "xmlSecNsExcC14NWithComments", (const char *)xmlSecNsExcC14NWithComments);

    PyModule_AddStringConstant(module, "xmlSecNodeInclusiveNamespaces", (const char *)xmlSecNodeInclusiveNamespaces);
    PyModule_AddStringConstant(module, "xmlSecAttrPrefixList", (const char *)xmlSecAttrPrefixList);
    /* DES strings */
    PyModule_AddStringConstant(module, "xmlSecNameDESKeyValue", (const char *)xmlSecNameDESKeyValue);
    PyModule_AddStringConstant(module, "xmlSecNodeDESKeyValue", (const char *)xmlSecNodeDESKeyValue);
    PyModule_AddStringConstant(module, "xmlSecHrefDESKeyValue", (const char *)xmlSecHrefDESKeyValue);

    PyModule_AddStringConstant(module, "xmlSecNameDes3Cbc", (const char *)xmlSecNameDes3Cbc);
    PyModule_AddStringConstant(module, "xmlSecHrefDes3Cbc", (const char *)xmlSecHrefDes3Cbc);

    PyModule_AddStringConstant(module, "xmlSecNameKWDes3", (const char *)xmlSecNameKWDes3);
    PyModule_AddStringConstant(module, "xmlSecHrefKWDes3", (const char *)xmlSecHrefKWDes3);
    /* DSA strings */
    PyModule_AddStringConstant(module, "xmlSecNameDSAKeyValue", (const char *)xmlSecNameDSAKeyValue);
    PyModule_AddStringConstant(module, "xmlSecNodeDSAKeyValue", (const char *)xmlSecNodeDSAKeyValue);
    PyModule_AddStringConstant(module, "xmlSecHrefDSAKeyValue", (const char *)xmlSecHrefDSAKeyValue);

    PyModule_AddStringConstant(module, "xmlSecNodeDSAP", (const char *)xmlSecNodeDSAP);
    PyModule_AddStringConstant(module, "xmlSecNodeDSAQ", (const char *)xmlSecNodeDSAQ);
    PyModule_AddStringConstant(module, "xmlSecNodeDSAG", (const char *)xmlSecNodeDSAG);
    PyModule_AddStringConstant(module, "xmlSecNodeDSAJ", (const char *)xmlSecNodeDSAJ);
    PyModule_AddStringConstant(module, "xmlSecNodeDSAX", (const char *)xmlSecNodeDSAX);
    PyModule_AddStringConstant(module, "xmlSecNodeDSAY", (const char *)xmlSecNodeDSAY);
    PyModule_AddStringConstant(module, "xmlSecNodeDSASeed", (const char *)xmlSecNodeDSASeed);
    PyModule_AddStringConstant(module, "xmlSecNodeDSAPgenCounter", (const char *)xmlSecNodeDSAPgenCounter);

    PyModule_AddStringConstant(module, "xmlSecNameDsaSha1", (const char *)xmlSecNameDsaSha1);
    PyModule_AddStringConstant(module, "xmlSecHrefDsaSha1", (const char *)xmlSecHrefDsaSha1);
    /* GOST2001 strings */
    PyModule_AddStringConstant(module, "xmlSecNameGOST2001KeyValue", (const char *)xmlSecNameGOST2001KeyValue);
    PyModule_AddStringConstant(module, "xmlSecNodeGOST2001KeyValue", (const char *)xmlSecNodeGOST2001KeyValue);
    PyModule_AddStringConstant(module, "xmlSecHrefGOST2001KeyValue", (const char *)xmlSecHrefGOST2001KeyValue);

    PyModule_AddStringConstant(module, "xmlSecNameGost2001GostR3411_94", (const char *)xmlSecNameGost2001GostR3411_94);
    PyModule_AddStringConstant(module, "xmlSecHrefGost2001GostR3411_94", (const char *)xmlSecHrefGost2001GostR3411_94);
    /* EncryptedKey */
    PyModule_AddStringConstant(module, "xmlSecNameEncryptedKey", (const char *)xmlSecNameEncryptedKey);
    PyModule_AddStringConstant(module, "xmlSecNodeEncryptedKey", (const char *)xmlSecNodeEncryptedKey);
    PyModule_AddStringConstant(module, "xmlSecHrefEncryptedKey", (const char *)xmlSecHrefEncryptedKey);
    /* Enveloped transform strings */
    PyModule_AddStringConstant(module, "xmlSecNameEnveloped", (const char *)xmlSecNameEnveloped);
    PyModule_AddStringConstant(module, "xmlSecHrefEnveloped", (const char *)xmlSecHrefEnveloped);
    /* HMAC strings */
    PyModule_AddStringConstant(module, "xmlSecNameHMACKeyValue", (const char *)xmlSecNameHMACKeyValue);
    PyModule_AddStringConstant(module, "xmlSecNodeHMACKeyValue", (const char *)xmlSecNodeHMACKeyValue);
    PyModule_AddStringConstant(module, "xmlSecHrefHMACKeyValue", (const char *)xmlSecHrefHMACKeyValue);

    PyModule_AddStringConstant(module, "xmlSecNodeHMACOutputLength", (const char *)xmlSecNodeHMACOutputLength);

    PyModule_AddStringConstant(module, "xmlSecNameHmacMd5", (const char *)xmlSecNameHmacMd5);
    PyModule_AddStringConstant(module, "xmlSecHrefHmacMd5", (const char *)xmlSecHrefHmacMd5);

    PyModule_AddStringConstant(module, "xmlSecNameHmacRipemd160", (const char *)xmlSecNameHmacRipemd160);
    PyModule_AddStringConstant(module, "xmlSecHrefHmacRipemd160", (const char *)xmlSecHrefHmacRipemd160);

    PyModule_AddStringConstant(module, "xmlSecNameHmacSha1", (const char *)xmlSecNameHmacSha1);
    PyModule_AddStringConstant(module, "xmlSecHrefHmacSha1", (const char *)xmlSecHrefHmacSha1);

    PyModule_AddStringConstant(module, "xmlSecNameHmacSha224", (const char *)xmlSecNameHmacSha224);
    PyModule_AddStringConstant(module, "xmlSecHrefHmacSha224", (const char *)xmlSecHrefHmacSha224);

    PyModule_AddStringConstant(module, "xmlSecNameHmacSha256", (const char *)xmlSecNameHmacSha256);
    PyModule_AddStringConstant(module, "xmlSecHrefHmacSha256", (const char *)xmlSecHrefHmacSha256);

    PyModule_AddStringConstant(module, "xmlSecNameHmacSha384", (const char *)xmlSecNameHmacSha384);
    PyModule_AddStringConstant(module, "xmlSecHrefHmacSha384", (const char *)xmlSecHrefHmacSha384);

    PyModule_AddStringConstant(module, "xmlSecNameHmacSha512", (const char *)xmlSecNameHmacSha512);
    PyModule_AddStringConstant(module, "xmlSecHrefHmacSha512", (const char *)xmlSecHrefHmacSha512);
    /* KeyName strings */
    PyModule_AddStringConstant(module, "xmlSecNameKeyName", (const char *)xmlSecNameKeyName);
    PyModule_AddStringConstant(module, "xmlSecNodeKeyName", (const char *)xmlSecNodeKeyName);
    /* KeyValue strings */
    PyModule_AddStringConstant(module, "xmlSecNameKeyValue", (const char *)xmlSecNameKeyValue);
    PyModule_AddStringConstant(module, "xmlSecNodeKeyValue", (const char *)xmlSecNodeKeyValue);
    /* Memory Buffer strings */
    PyModule_AddStringConstant(module, "xmlSecNameMemBuf", (const char *)xmlSecNameMemBuf);
    /* MD5 strings */
    PyModule_AddStringConstant(module, "xmlSecNameMd5", (const char *)xmlSecNameMd5);
    PyModule_AddStringConstant(module, "xmlSecHrefMd5", (const char *)xmlSecHrefMd5);
    /* RetrievalMethod */
    PyModule_AddStringConstant(module, "xmlSecNameRetrievalMethod", (const char *)xmlSecNameRetrievalMethod);
    PyModule_AddStringConstant(module, "xmlSecNodeRetrievalMethod", (const char *)xmlSecNodeRetrievalMethod);
    /* RIPEMD160 strings */
    PyModule_AddStringConstant(module, "xmlSecNameRipemd160", (const char *)xmlSecNameRipemd160);
    PyModule_AddStringConstant(module, "xmlSecHrefRipemd160", (const char *)xmlSecHrefRipemd160);
    /* RSA strings */
    PyModule_AddStringConstant(module, "xmlSecNameRSAKeyValue", (const char *)xmlSecNameRSAKeyValue);
    PyModule_AddStringConstant(module, "xmlSecNodeRSAKeyValue", (const char *)xmlSecNodeRSAKeyValue);
    PyModule_AddStringConstant(module, "xmlSecHrefRSAKeyValue", (const char *)xmlSecHrefRSAKeyValue);

    PyModule_AddStringConstant(module, "xmlSecNodeRSAModulus", (const char *)xmlSecNodeRSAModulus);
    PyModule_AddStringConstant(module, "xmlSecNodeRSAExponent", (const char *)xmlSecNodeRSAExponent);
    PyModule_AddStringConstant(module, "xmlSecNodeRSAPrivateExponent", (const char *)xmlSecNodeRSAPrivateExponent);

    PyModule_AddStringConstant(module, "xmlSecNameRsaMd5", (const char *)xmlSecNameRsaMd5);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaMd5", (const char *)xmlSecHrefRsaMd5);

    PyModule_AddStringConstant(module, "xmlSecNameRsaRipemd160", (const char *)xmlSecNameRsaRipemd160);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaRipemd160", (const char *)xmlSecHrefRsaRipemd160);

    PyModule_AddStringConstant(module, "xmlSecNameRsaSha1", (const char *)xmlSecNameRsaSha1);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaSha1", (const char *)xmlSecHrefRsaSha1);

    PyModule_AddStringConstant(module, "xmlSecNameRsaSha224", (const char *)xmlSecNameRsaSha224);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaSha224", (const char *)xmlSecHrefRsaSha224);

    PyModule_AddStringConstant(module, "xmlSecNameRsaSha256", (const char *)xmlSecNameRsaSha256);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaSha256", (const char *)xmlSecHrefRsaSha256);

    PyModule_AddStringConstant(module, "xmlSecNameRsaSha384", (const char *)xmlSecNameRsaSha384);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaSha384", (const char *)xmlSecHrefRsaSha384);

    PyModule_AddStringConstant(module, "xmlSecNameRsaSha512", (const char *)xmlSecNameRsaSha512);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaSha512", (const char *)xmlSecHrefRsaSha512);

    PyModule_AddStringConstant(module, "xmlSecNameRsaPkcs1", (const char *)xmlSecNameRsaPkcs1);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaPkcs1", (const char *)xmlSecHrefRsaPkcs1);

    PyModule_AddStringConstant(module, "xmlSecNameRsaOaep", (const char *)xmlSecNameRsaOaep);
    PyModule_AddStringConstant(module, "xmlSecHrefRsaOaep", (const char *)xmlSecHrefRsaOaep);
    PyModule_AddStringConstant(module, "xmlSecNodeRsaOAEPparams", (const char *)xmlSecNodeRsaOAEPparams);
    /* GOSTR3411_94 strings */
    PyModule_AddStringConstant(module, "xmlSecNameGostR3411_94", (const char *)xmlSecNameGostR3411_94);
    PyModule_AddStringConstant(module, "xmlSecHrefGostR3411_94", (const char *)xmlSecHrefGostR3411_94);
    /* SHA1 strings */
    PyModule_AddStringConstant(module, "xmlSecNameSha1", (const char *)xmlSecNameSha1);
    PyModule_AddStringConstant(module, "xmlSecHrefSha1", (const char *)xmlSecHrefSha1);

    PyModule_AddStringConstant(module, "xmlSecNameSha224", (const char *)xmlSecNameSha224);
    PyModule_AddStringConstant(module, "xmlSecHrefSha224", (const char *)xmlSecHrefSha224);

    PyModule_AddStringConstant(module, "xmlSecNameSha256", (const char *)xmlSecNameSha256);
    PyModule_AddStringConstant(module, "xmlSecHrefSha256", (const char *)xmlSecHrefSha256);

    PyModule_AddStringConstant(module, "xmlSecNameSha384", (const char *)xmlSecNameSha384);
    PyModule_AddStringConstant(module, "xmlSecHrefSha384", (const char *)xmlSecHrefSha384);

    PyModule_AddStringConstant(module, "xmlSecNameSha512", (const char *)xmlSecNameSha512);
    PyModule_AddStringConstant(module, "xmlSecHrefSha512", (const char *)xmlSecHrefSha512);
    /* X509 strings */
    PyModule_AddStringConstant(module, "xmlSecNameX509Data", (const char *)xmlSecNameX509Data);
    PyModule_AddStringConstant(module, "xmlSecNodeX509Data", (const char *)xmlSecNodeX509Data);
    PyModule_AddStringConstant(module, "xmlSecHrefX509Data", (const char *)xmlSecHrefX509Data);

    PyModule_AddStringConstant(module, "xmlSecNodeX509Certificate", (const char *)xmlSecNodeX509Certificate);
    PyModule_AddStringConstant(module, "xmlSecNodeX509CRL", (const char *)xmlSecNodeX509CRL);
    PyModule_AddStringConstant(module, "xmlSecNodeX509SubjectName", (const char *)xmlSecNodeX509SubjectName);
    PyModule_AddStringConstant(module, "xmlSecNodeX509IssuerSerial", (const char *)xmlSecNodeX509IssuerSerial);
    PyModule_AddStringConstant(module, "xmlSecNodeX509IssuerName", (const char *)xmlSecNodeX509IssuerName);
    PyModule_AddStringConstant(module, "xmlSecNodeX509SerialNumber", (const char *)xmlSecNodeX509SerialNumber);
    PyModule_AddStringConstant(module, "xmlSecNodeX509SKI", (const char *)xmlSecNodeX509SKI);

    PyModule_AddStringConstant(module, "xmlSecNameRawX509Cert", (const char *)xmlSecNameRawX509Cert);
    PyModule_AddStringConstant(module, "xmlSecHrefRawX509Cert", (const char *)xmlSecHrefRawX509Cert);

    PyModule_AddStringConstant(module, "xmlSecNameX509Store", (const char *)xmlSecNameX509Store);
    /* PGP strings */
    PyModule_AddStringConstant(module, "xmlSecNamePGPData", (const char *)xmlSecNamePGPData);
    PyModule_AddStringConstant(module, "xmlSecNodePGPData", (const char *)xmlSecNodePGPData);
    PyModule_AddStringConstant(module, "xmlSecHrefPGPData", (const char *)xmlSecHrefPGPData);
    /* SPKI strings */
    PyModule_AddStringConstant(module, "xmlSecNameSPKIData", (const char *)xmlSecNameSPKIData);
    PyModule_AddStringConstant(module, "xmlSecNodeSPKIData", (const char *)xmlSecNodeSPKIData);
    PyModule_AddStringConstant(module, "xmlSecHrefSPKIData", (const char *)xmlSecHrefSPKIData);
    /* XPath/XPointer strings */
    PyModule_AddStringConstant(module, "xmlSecNameXPath", (const char *)xmlSecNameXPath);
    PyModule_AddStringConstant(module, "xmlSecNodeXPath", (const char *)xmlSecNodeXPath);

    PyModule_AddStringConstant(module, "xmlSecNameXPath2", (const char *)xmlSecNameXPath2);
    PyModule_AddStringConstant(module, "xmlSecNodeXPath2", (const char *)xmlSecNodeXPath2);
    PyModule_AddStringConstant(module, "xmlSecXPath2FilterIntersect", (const char *)xmlSecXPath2FilterIntersect);
    PyModule_AddStringConstant(module, "xmlSecXPath2FilterSubtract", (const char *)xmlSecXPath2FilterSubtract);
    PyModule_AddStringConstant(module, "xmlSecXPath2FilterUnion", (const char *)xmlSecXPath2FilterUnion);
    PyModule_AddStringConstant(module, "xmlSecNameXPointer", (const char *)xmlSecNameXPointer);
    PyModule_AddStringConstant(module, "xmlSecNodeXPointer", (const char *)xmlSecNodeXPointer);
    /* Xslt strings */
    PyModule_AddStringConstant(module, "xmlSecNameXslt", (const char *)xmlSecNameXslt);
    PyModule_AddStringConstant(module, "xmlSecHrefXslt", (const char *)xmlSecHrefXslt);
#ifndef XMLSEC_NO_SOAP
    /* SOAP 1.1/1.2 strings */
    PyModule_AddStringConstant(module, "xmlSecNodeEnvelope", (const char *)xmlSecNodeEnvelope);
    PyModule_AddStringConstant(module, "xmlSecNodeHeader", (const char *)xmlSecNodeHeader);
    PyModule_AddStringConstant(module, "xmlSecNodeBody", (const char *)xmlSecNodeBody);
    PyModule_AddStringConstant(module, "xmlSecNodeFault", (const char *)xmlSecNodeFault);
    PyModule_AddStringConstant(module, "xmlSecNodeFaultCode", (const char *)xmlSecNodeFaultCode);
    PyModule_AddStringConstant(module, "xmlSecNodeFaultString", (const char *)xmlSecNodeFaultString);
    PyModule_AddStringConstant(module, "xmlSecNodeFaultActor", (const char *)xmlSecNodeFaultActor);
    PyModule_AddStringConstant(module, "xmlSecNodeFaultDetail", (const char *)xmlSecNodeFaultDetail);
    PyModule_AddStringConstant(module, "xmlSecNodeCode", (const char *)xmlSecNodeCode);
    PyModule_AddStringConstant(module, "xmlSecNodeReason", (const char *)xmlSecNodeReason);
    PyModule_AddStringConstant(module, "xmlSecNodeNode", (const char *)xmlSecNodeNode);
    PyModule_AddStringConstant(module, "xmlSecNodeRole", (const char *)xmlSecNodeRole);
    PyModule_AddStringConstant(module, "xmlSecNodeDetail", (const char *)xmlSecNodeDetail);
    PyModule_AddStringConstant(module, "xmlSecNodeValue", (const char *)xmlSecNodeValue);
    PyModule_AddStringConstant(module, "xmlSecNodeSubcode", (const char *)xmlSecNodeSubcode);
    PyModule_AddStringConstant(module, "xmlSecNodeText", (const char *)xmlSecNodeText);

    PyModule_AddStringConstant(module, "xmlSecSoapFaultCodeVersionMismatch", (const char *)xmlSecSoapFaultCodeVersionMismatch);
    PyModule_AddStringConstant(module, "xmlSecSoapFaultCodeMustUnderstand", (const char *)xmlSecSoapFaultCodeMustUnderstand);
    PyModule_AddStringConstant(module, "xmlSecSoapFaultCodeClient", (const char *)xmlSecSoapFaultCodeClient);
    PyModule_AddStringConstant(module, "xmlSecSoapFaultCodeServer", (const char *)xmlSecSoapFaultCodeServer);
    PyModule_AddStringConstant(module, "xmlSecSoapFaultCodeReceiver", (const char *)xmlSecSoapFaultCodeReceiver);
    PyModule_AddStringConstant(module, "xmlSecSoapFaultCodeSender", (const char *)xmlSecSoapFaultCodeSender);
    PyModule_AddStringConstant(module, "xmlSecSoapFaultDataEncodningUnknown", (const char *)xmlSecSoapFaultDataEncodningUnknown);
#endif
    /* Utility strings */
    PyModule_AddStringConstant(module, "xmlSecStringEmpty", (const char *)xmlSecStringEmpty);
    PyModule_AddStringConstant(module, "xmlSecStringCR", (const char *)xmlSecStringCR);
    /* ** xmldsig ** */
    /* xmlSecDSigStatus */
    PyModule_AddIntConstant(module, "xmlSecDSigStatusUnknown", xmlSecDSigStatusUnknown);
    PyModule_AddIntConstant(module, "xmlSecDSigStatusSucceeded", xmlSecDSigStatusSucceeded);
    PyModule_AddIntConstant(module, "xmlSecDSigStatusInvalid", xmlSecDSigStatusInvalid);
    /* flags */
    PyModule_AddIntMacro(module, XMLSEC_DSIG_FLAGS_IGNORE_MANIFESTS);
    PyModule_AddIntMacro(module, XMLSEC_DSIG_FLAGS_STORE_SIGNEDINFO_REFERENCES);
    PyModule_AddIntMacro(module, XMLSEC_DSIG_FLAGS_STORE_MANIFEST_REFERENCES);
    PyModule_AddIntMacro(module, XMLSEC_DSIG_FLAGS_STORE_SIGNATURE);
    PyModule_AddIntMacro(module, XMLSEC_DSIG_FLAGS_USE_VISA3D_HACK);
    /* ** nodeset ** */
    /* xmlSecNodeSetType */
    PyModule_AddIntConstant(module, "xmlSecNodeSetNormal", xmlSecNodeSetNormal);
    PyModule_AddIntConstant(module, "xmlSecNodeSetInvert", xmlSecNodeSetInvert);
    PyModule_AddIntConstant(module, "xmlSecNodeSetTree", xmlSecNodeSetTree);
    PyModule_AddIntConstant(module, "xmlSecNodeSetTreeWithoutComments", xmlSecNodeSetTreeWithoutComments);
    PyModule_AddIntConstant(module, "xmlSecNodeSetTreeInvert", xmlSecNodeSetTreeInvert);
    PyModule_AddIntConstant(module, "xmlSecNodeSetTreeWithoutCommentsInvert", xmlSecNodeSetTreeWithoutCommentsInvert);
    PyModule_AddIntConstant(module, "xmlSecNodeSetList", xmlSecNodeSetList);
    /* xmlSecNodeSetOp */
    PyModule_AddIntConstant(module, "xmlSecNodeSetIntersection", xmlSecNodeSetIntersection);
    PyModule_AddIntConstant(module, "xmlSecNodeSetSubtraction", xmlSecNodeSetSubtraction);
    PyModule_AddIntConstant(module, "xmlSecNodeSetUnion", xmlSecNodeSetUnion);

    /* ** compile-time bits 'n pieces ** */
#if defined(XMLSEC_CRYPTO)
    PyModule_AddStringMacro(module, XMLSEC_CRYPTO);
#endif
    /*
     * Set up our exception hierarchy and error->exception translation callback
     */
    st = GETSTATE(module);

    if (NULL == (st->error = PyErr_NewException("xmlsec1.Error", PyExc_Exception, NULL)))
    {
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->xmlSecFailed = PyErr_NewException("xmlsec1.XmlSecFailed", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->cryptoFailed = PyErr_NewException("xmlsec1.CryptoFailed", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->xmlFailed = PyErr_NewException("xmlsec1.XmlFailed", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->xsltFailed = PyErr_NewException("xmlsec1.XsltFailed", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->ioFailed = PyErr_NewException("xmlsec1.IOFailed", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->disabled = PyErr_NewException("xmlsec1.Disabled", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidSize = PyErr_NewException("xmlsec1.InvalidSize", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidData = PyErr_NewException("xmlsec1.InvalidData", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidResult = PyErr_NewException("xmlsec1.InvalidResult", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidType = PyErr_NewException("xmlsec1.InvalidType", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidOperation = PyErr_NewException("xmlsec1.InvalidOperation", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidStatus = PyErr_NewException("xmlsec1.InvalidStatus", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidFormat = PyErr_NewException("xmlsec1.InvalidFormat", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->dataNotMatch = PyErr_NewException("xmlsec1.DataNotMatch", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidNode = PyErr_NewException("xmlsec1.InvalidNode", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidNodeContent = PyErr_NewException("xmlsec1.InvalidNodeContent", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidNodeAttribute = PyErr_NewException("xmlsec1.InvalidNodeAttribute", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->missingNodeAttribute = PyErr_NewException("xmlsec1.MissingNodeAttribute", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->nodeAlreadyPresent = PyErr_NewException("xmlsec1.NodeAlreadyPresent", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->unexpectedNode = PyErr_NewException("xmlsec1.UnexpectedNode", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->nodeNotFound = PyErr_NewException("xmlsec1.NodeNotFound", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidTransform = PyErr_NewException("xmlsec1.InvalidTransform", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidTransformKey = PyErr_NewException("xmlsec1.InvalidTransformKey", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidUriType = PyErr_NewException("xmlsec1.InvalidUriType", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->transformSameDocumentRequired = PyErr_NewException("xmlsec1.TransformSameDocumentRequired", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->transformDisabled = PyErr_NewException("xmlsec1.TransformDisabled", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidKeyData = PyErr_NewException("xmlsec1.InvalidKeyData", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->keyDataNotFound = PyErr_NewException("xmlsec1.KeyDataNotFound", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->keyDataAlreadyExist = PyErr_NewException("xmlsec1.KeyDataAlreadyExist", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->invalidKeyDataSize = PyErr_NewException("xmlsec1.InvalidKeyDataSize", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->keyNotFound = PyErr_NewException("xmlsec1.KeyNotFound", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->keyDataDisabled = PyErr_NewException("xmlsec1.KeyDataDisabled", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->maxRetrievalsLevel = PyErr_NewException("xmlsec1.MaxRetrievalsLevel", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->maxRetrievalTypeMismatch = PyErr_NewException("xmlsec1.MaxRetrievalTypeMismatch", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->maxEncryptedKeyLevel = PyErr_NewException("xmlsec1.MaxEncryptedKeyLevel", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->certificateVerifyFailed = PyErr_NewException("xmlsec1.CertificateVerifyFailed", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->certificateNotFound = PyErr_NewException("xmlsec1.CertificateNotFound", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->certificateRevoked = PyErr_NewException("xmlsec1.CertificateRevoked", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->certificateIssuerFailed = PyErr_NewException("xmlsec1.CertificateIssuerFailed", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->certificateNotYetValid = PyErr_NewException("xmlsec1.CertificateNotYetValid", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->certificateHasExpired = PyErr_NewException("xmlsec1.CertificateHasExpired", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->dsigNoReferences = PyErr_NewException("xmlsec1.DsigNoReferences", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->dsigInvalidReference = PyErr_NewException("xmlsec1.DsigInvalidReference", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    if (NULL == (st->assertion = PyErr_NewException("xmlsec1.Assertion", st->error, NULL)))
    {
        xmlsec1mod_clear_module_state_vars(st);
        Py_DECREF(module);
        INITERROR;
    }

    xmlSecErrorsSetCallback(xmlsec1mod_xmlSecErrorsCallback);

#if PY_MAJOR_VERSION >= 3
    return module;
#endif
}

#endif
